Since NPM and CNPM are able to install components, some of the installed components are stored in the C-drive user directory of the AppData hidden directory, and some are saved in the directory of the installation node, and installed in the C drive, the reinstall system has to be re-deployed, it is troublesome, so here to provide elegant installation of the way, no longer afraid of reloading system , no longer afraid of components can not be found on the package.
Download Node-v4.2.4.rar decompression to the corresponding directory, I was reduced to "D:\Program Files" under this directory
Download path: [Node-v4.2.4.rar] (http://download.csdn.net/detail/as763190097/9410428)
Configuration of environment variables:
1. Add ————-in the path variable to replace your own corresponding directory
";D: \program Files\node\nodejs;d:\program Files\node\node-global"
2. Add a system variable Node_path
Value is
";D: \program Files\node\node-global\node_modules;d:\program Files\node\nodejs\node_modules"
3. Add a user variable to the path
";D: \program Files\node\nodejs\node_modules\npm"
If you have previously installed node, modify this path
After this step, you can test the node environment, enter NODE-V input NPM-V test environment variables are paired
4. Configure the Global module storage path and cache path for NPM
Enter the following command
NPM config set prefix "D:\Program files\node\node-global"
NPM config set cache "D:\Program Files\node\node-cache"
5. Installing CNPM
Enter the command under CMD:
NPM Install Cnpm-g
6. Set the global module storage path and cache path for the CNPM
CNPM config set prefix "D:\Program files\node\node-global"
CNPM config set cache "D:\Program Files\node\node-cache"
The modules that NPM and CNPM install later are all in the D:\Program files\node\node-global\node_modules directory.
Nodejs NPM cnpm Elegant installation Install