0% found this document useful (0 votes)
18 views9 pages

Node.js Express App Setup Guide

The document details the steps taken to set up and run a Node.js/Express application on a Windows system. It shows installing Node.js and the express-generator, using express-generator to create an Express app scaffold called "myapp", installing dependencies, resolving errors when initially running the app, and initializing a package.json file. The app is then successfully running on port 8080.

Uploaded by

Cedrix Tumlos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views9 pages

Node.js Express App Setup Guide

The document details the steps taken to set up and run a Node.js/Express application on a Windows system. It shows installing Node.js and the express-generator, using express-generator to create an Express app scaffold called "myapp", installing dependencies, resolving errors when initially running the app, and initializing a package.json file. The app is then successfully running on port 8080.

Uploaded by

Cedrix Tumlos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Your environment has been set up for using [Link] 10.11.0 (x64) and npm.

C:\Users\ctumlos>npm install express-generator -g

C:\Users\ctumlos\AppData\Roaming\npm\express ->
C:\Users\ctumlos\AppData\Roaming\npm\node_modules\express-generator\bin\[Link]

+ express-generator@4.16.0

added 10 packages from 13 contributors in 6.506s

C:\Users\ctumlos>express myapp

warning: the default view engine will not be jade in future releases

warning: use `--view=jade' or `--help' for additional options

create : myapp\

create : myapp\public\

create : myapp\public\javascripts\

create : myapp\public\images\

create : myapp\public\stylesheets\

create : myapp\public\stylesheets\[Link]

create : myapp\routes\

create : myapp\routes\[Link]

create : myapp\routes\[Link]

create : myapp\views\

create : myapp\views\[Link]

create : myapp\views\[Link]

create : myapp\views\[Link]

create : myapp\[Link]

create : myapp\[Link]
create : myapp\bin\

create : myapp\bin\www

change directory:

> cd myapp

install dependencies:

> npm install

run the app:

> SET DEBUG=myapp:* & npm start

C:\Users\ctumlos>cd myapp

C:\Users\ctumlos\myapp>node [Link]

internal/modules/cjs/[Link]

throw err;

Error: Cannot find module 'http-errors'

at [Link]._resolveFilename (internal/modules/cjs/[Link]:15)

at [Link]._load (internal/modules/cjs/[Link]:25)

at [Link] (internal/modules/cjs/[Link]:17)

at require (internal/modules/cjs/[Link]:18)

at Object.<anonymous> (C:\Users\ctumlos\myapp\[Link]:81)

at Module._compile (internal/modules/cjs/[Link]:30)

at [Link]._extensions..js (internal/modules/cjs/[Link]:10)

at [Link] (internal/modules/cjs/[Link]:32)
at tryModuleLoad (internal/modules/cjs/[Link]:12)

at [Link]._load (internal/modules/cjs/[Link]:3)

C:\Users\ctumlos\myapp>npm install

npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of
pug instead of jade

npm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1

npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer

npm notice created a lockfile as [Link]. You should commit this file.

added 99 packages from 139 contributors and audited 194 packages in 20.521s

found 2 low severity vulnerabilities

run `npm audit fix` to fix them, or `npm audit` for details

C:\Users\ctumlos\myapp>node [Link]

C:\Users\ctumlos\myapp>node [Link]

C:\Users\ctumlos\myapp>node [Link]

C:\Users\ctumlos\myapp>npm init

This utility will walk you through creating a [Link] file.

It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields

and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and

save it as a dependency in the [Link] file.


Press ^C at any time to quit.

package name: (myapp) app

version: (1.0.0) 1

Invalid version: "1"

version: (1.0.0) 1.0.0

description:

entry point: ([Link]) [Link]

test command:

git repository:

keywords:

author:

license: (ISC)

About to write to C:\Users\ctumlos\myapp\[Link]:

"name": "app",

"version": "1.0.0",

"description": "",

"main": "[Link]",

"scripts": {

"test": "echo \"Error: no test specified\" && exit 1"

},

"author": "",

"license": "ISC"

Is this OK? (yes) yes


C:\Users\ctumlos\myapp>dir

Volume in drive C is SOE

Volume Serial Number is 4415-8BB5

Directory of C:\Users\ctumlos\myapp

11/05/2018 08:43 PM <DIR> .

11/05/2018 08:43 PM <DIR> ..

11/05/2018 08:43 PM 197 [Link]

1 File(s) 197 bytes

2 Dir(s) 182,984,425,472 bytes free

C:\Users\ctumlos\myapp>node [Link]

internal/modules/cjs/[Link]

throw err;

Error: Cannot find module 'express'

at [Link]._resolveFilename (internal/modules/cjs/[Link]:15)

at [Link]._load (internal/modules/cjs/[Link]:25)

at [Link] (internal/modules/cjs/[Link]:17)

at require (internal/modules/cjs/[Link]:18)

at Object.<anonymous> (C:\Users\ctumlos\myapp\[Link]:79)

at Module._compile (internal/modules/cjs/[Link]:30)

at [Link]._extensions..js (internal/modules/cjs/[Link]:10)

at [Link] (internal/modules/cjs/[Link]:32)

at tryModuleLoad (internal/modules/cjs/[Link]:12)

at [Link]._load (internal/modules/cjs/[Link]:3)
C:\Users\ctumlos\myapp>npm install express --save

npm notice created a lockfile as [Link]. You should commit this file.

npm WARN app@1.0.0 No description

npm WARN app@1.0.0 No repository field.

+ express@4.16.4

added 48 packages from 36 contributors and audited 121 packages in 11.488s

found 0 vulnerabilities

C:\Users\ctumlos\myapp>npm install http --save

npm WARN app@1.0.0 No description

npm WARN app@1.0.0 No repository field.

+ http@0.0.0

added 1 package and audited 122 packages in 3.753s

found 0 vulnerabilities

C:\Users\ctumlos\myapp>npm install querystring --save

npm WARN app@1.0.0 No description

npm WARN app@1.0.0 No repository field.

+ querystring@0.2.0

added 1 package from 1 contributor and audited 123 packages in 4.157s

found 0 vulnerabilities

C:\Users\ctumlos\myapp>
C:\Users\ctumlos\myapp>npm install request-promise --save

npm WARN request-promise@4.2.2 requires a peer of request@^2.34 but none is installed. You must
install peer dependencies yourself.

npm WARN request-promise-core@1.1.1 requires a peer of request@^2.34 but none is installed. You
must install peer dependencies yourself.

npm WARN app@1.0.0 No description

npm WARN app@1.0.0 No repository field.

+ request-promise@4.2.2

added 8 packages from 14 contributors and audited 131 packages in 12.137s

found 0 vulnerabilities

C:\Users\ctumlos\myapp>node [Link]

###

### The "request" library is not installed automatically anymore.

### But required by "request-promise".

###

### npm install request --save

###

C:\Users\ctumlos\myapp\node_modules\request-promise\lib\[Link]

throw err;

Error: Cannot find module 'request'

at [Link]._resolveFilename (internal/modules/cjs/[Link]:15)

at [Link]._load (internal/modules/cjs/[Link]:25)
at [Link] (internal/modules/cjs/[Link]:17)

at require (internal/modules/cjs/[Link]:18)

at C:\Users\ctumlos\myapp\node_modules\request-promise\lib\[Link]:16

at [Link] (C:\Users\ctumlos\myapp\node_modules\stealthy-require\lib\[Link]:23)

at Object.<anonymous> (C:\Users\ctumlos\myapp\node_modules\request-promise\lib\[Link]:19)

at Module._compile (internal/modules/cjs/[Link]:30)

at [Link]._extensions..js (internal/modules/cjs/[Link]:10)

at [Link] (internal/modules/cjs/[Link]:32)

at tryModuleLoad (internal/modules/cjs/[Link]:12)

at [Link]._load (internal/modules/cjs/[Link]:3)

at [Link] (internal/modules/cjs/[Link]:17)

at require (internal/modules/cjs/[Link]:18)

at Object.<anonymous> (C:\Users\ctumlos\myapp\[Link]:21)

at Module._compile (internal/modules/cjs/[Link]:30)

at [Link]._extensions..js (internal/modules/cjs/[Link]:10)

at [Link] (internal/modules/cjs/[Link]:32)

at tryModuleLoad (internal/modules/cjs/[Link]:12)

at [Link]._load (internal/modules/cjs/[Link]:3)

at [Link] (internal/modules/cjs/[Link]:12)

at startup (internal/bootstrap/[Link]:19)

C:\Users\ctumlos\myapp>npm install request --save

npm WARN app@1.0.0 No description

npm WARN app@1.0.0 No repository field.

+ request@2.88.0

added 39 packages from 41 contributors and audited 193 packages in 11.949s

found 0 vulnerabilities
C:\Users\ctumlos\myapp>node [Link]

Express server listening on port 8080

^C

C:\Users\ctumlos\myapp>node [Link]

Express server listening on port 8080

hello world

hello world

^C

C:\Users\ctumlos\myapp>node [Link]

Express server listening on port 8080

hello world

--save (to save in the json package)

Get the value in the parent of catalog_task


RITM: Value to get the number

GET [Link]
sysparm_query=sys_id
%3Daeed229047801200e0ef563dbb9a71c2&sysparm_limit=10
sys_id-RITM
parent.sys_id

6eed229047801200e0ef563dbb9a71c2

Request{

Value=6eed229047801200e0ef563dbb9a71c2 for WO

You might also like