Download---Install to D:\Develop---installation
Check if node is installed successfully: WINDOW+R---cmd---node-v
Check npm:window+r---cmd---npm-v
The directory after installation is as follows:
To configure environment variables:
1, create two folders under D:\Develop\nodejs "Node_global" and "Node_cache"
- Node_cache: Cache Directory
- Node_global: Global Package Directory
2, after creating two empty folders, open the cmd command window and enter:
NPM config set prefix "D:\Develop\nodejs\node_global"npm config set cache"D:\Develop\nodejs\node_cache
3, Next set environment variable, close cmd window, "My Computer"-Right-click "Properties"-"Advanced system Settings"-"Advanced"-"Environment variable"
User Variable--path--edit:
System Variables--NEW:
Check that the global variables are configured well:
1,
NPM install express-g #-G is the meaning of the global installation
Enter node, and then enter "require (' Express ')" to test whether the global path of the node module is configured correctly.
Final Result:
The environment variables are well-equipped.
Reference:
Https://www.jianshu.com/p/03a76b2e7e00
Windows post for node. JS Installation and Environment configuration