If you want to install the Nodejs not installed can go to download: http://nodejs.org/ 1, open cmd execute the following command:
①, we will first configure NPM's global module storage path and cache path, for example, I would like to put the above two folders in the Nodejs's home directory, under the Nodejs set up "Node_global" and "Node_cache" two folder.
②, start cmd, input:
npm config set prefix "C:\Program files\nodejs\node_global
npm config set cache" C:\Program Files\nodejs\node_cache "
③, now we have to install a module to try, choose Express this more commonly used modules." Also in the cmd command line, enter "NPM Install Express-g" ("G" This parameter means to be loaded into the global directory, which is said to set the "C:\Program Files\nodejs\node_global" inside. )。 After the installation of CMD inside the completion of the scroll, will prompt "Express" installed in the version and its directory structure is how.
2, configure the environment variable to path:
Enter the environment Variable dialog box, create a new "Node_path" under the system variable, and enter "C:\Program files\nodejs\node_global\node_modules". (PS: This step is quite critical.)
because the default address of module is changed, the user variables above are changed (user variable "PATH" is modified to "C:\Program files\nodejs\node_global\"), If you do not use module, the input command appears with the error "XXX is not an internal or external command, nor a running program or batch file."