---restore content starts---
1.node. JS Official installation package and source code: http://nodejs.org/download/
As shown:
3. Click Next
4, tick "I accept the terms in the License agreement" agree to the license agreement, and click Next Next, the following interface appears:
5.node. JS default installation path is "C:\Program files\nodejs\", you can modify the path
6, here I directly default next next, ready to install:
7. After installation, open the Run Command window and enter CMD. Enter NODE-V to test whether the installation was successful,
8, NPM as a Nodejs module management
--We need to configure the path of the global module of NPM and the path of the cache, for example, I would like to place the above two folders in Nodejs's home directory, then set up "Node_global" and "Node_cache" two folder under Nodejs.
--Install the Express module.
NPM config set prefix "C:\Program files\nodejs\node_global"
NPM config set cache "C:\Program files\nodejs\node_cache"
In the command line, enter NPM install Express-g
After installing Express, creating a new project sometimes encounters an abnormal situation, prompting that "Express is not internal or external command " because the command tool is express4.x in the version, and a command tool needs to be installed.
Execute command "npm install-g express-generator"
It will be done after the test.
Before using the Express command, you also need to configure the environment variables.
Not using the module causes the input command to appear "XXX is not an internal or external command, it is not a running program or batch file" error.
At the end of PATH add ";%node_path%";
If all the above steps are OK, we can open the cmd command line again, enter node and type "require (' Express ')"
To test whether the module global path for node is configured correctly. The correct CMD will list information about the Express.
---restore content ends---
node. JS Installation Steps