Installation of the node. JS Framework Express
First assume that you have node. js installed, then create a directory for your app, and then go to this directory and use it as your current working directory.
$ mkdir myapp$ cd myapp
npm init
Create a file for your app with the command package.json
. For more information package.json
on how this works, please refer to specifics of NPM's package.json handling.
$ npm init
This command will ask you to enter several parameters, such as the name and version of the app. You can simply press the "enter" key to accept the default settings, except for the following:
entry point: (index.js)
Type app.js
or the name you want, which is the entry file for the current application. If you want to use the default index.js
file name, just press the "enter" key.
Next, install Express and save it to the dependencies list:
$ npm install express --save
If you just install Express temporarily and don't want to add it to the dependency list, simply omit the --save
parameters:
$ npm install express
When the Node module is installed, if a parameter is specified --save
, the module is added to the package.json
dependency list in the file dependencies
. npm install
all modules listed in the dependency list are then automatically installed by command.
Installation of the node. JS Framework Express