0% found this document useful (0 votes)
47 views1 page

Installing ExpressJS

To install ExpressJS, first create a directory for your application and make it your working directory. Run npm init to generate a package.json file, accepting most defaults but specifying the entry point file such as app.js. Then install Express by running npm install express --save, which will add Express as a dependency in package.json.
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)
47 views1 page

Installing ExpressJS

To install ExpressJS, first create a directory for your application and make it your working directory. Run npm init to generate a package.json file, accepting most defaults but specifying the entry point file such as app.js. Then install Express by running npm install express --save, which will add Express as a dependency in package.json.
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
You are on page 1/ 1

Installing ExpressJS

Assuming you’ve already installed Node.js, create a directory to hold your application, and make that your
working directory.
$ mkdir myapp
$ cd myapp

Use the npm init command to create a package.json file for your application. For more information on
how package.json works, see Specifics of npm’s package.json handling.

$ npm init

This command prompts you for a number of things, such as the name and version of your application. For now,
you can simply hit RETURN to accept the defaults for most of them, with the following exception:
entry point: (index.js)

Enter app.js, or whatever you want the name of the main file to be. If you want it to be index.js, hit
RETURN to accept the suggested default file name.

Now install Express in the myapp directory and save it in the dependencies list. For example:

$ npm install express --save

To install Express temporarily and not add it to the dependencies list:


$ npm install express --no-save

You might also like