Original article link: http://blog.csdn.net/xxmeng2012/article/details/51492149| very grateful to the original article Bo master to provide sharing
1, download the node installation package, the official website Zip package for decompression free installation version, the need to configure environment variables. The MSI version is the installation version, where the MSI version is used, which automatically adds the Path,path value to the installation path.
2, install Si cho Good installation path directly click Next to complete, detection is OK:
2.1 Win+r
2.2 Node-v
2.3 npm-v
2.2 and 2.3 Enter separately, and the corresponding version number in the terminal indicates that the installation is complete. Right after the direct node return to enter node development mode
3, Nodet through NPM to manage the installation package (domestic may need to use CNPM), sometimes you may need to configure a custom directory to manage the installation package, then continue to configure the following:
3.1 Create the corresponding directory in the specified directory, for example, using the original blogger's Node_global and Node_cache, built in the node home directory
3.2 Enter CMD, use
NPM config set prefix "Node_global Directory Absolute Path" (carriage return)
NPM config Set cache "Node_cache Directory absolute Path" (carriage return)
3.3 Install a module to test whether the path configured in 3.2 is in effect
NPM Install Express-g #安装express模块到全局路径 (the screen terminal will scroll to display the Express installation directory tree structure during installation)
3.4 Configuring environment variables
• System variables add node_path and corresponding values
• User variable path needs to add the node installation path to the absolute path to Node_global #否则会出现命令无法使用
3.5 Verify that the node module path is fully configured
3.5.1 into CMD terminal
3.5.2 Node (enter)
3.5.3 require (' Express ') #装载express模块, appears as configuration complete.
Nodejs+npm+windows Configuration