Today I have nothing to think of node. js, so I downloaded a node. JS installer to the web for installation. which
Setup: Node-v0.11.13-x64.msi PC system: Windows 7 Custom installation path: D:\TOOLS\NodeJs
After the installation is complete, execute: d:\tools\nodejs>node-v v0.11.13
Install Frame Express, from the website downloaded an installation document, said to install Express can be divided into global mode and local mode, the individual feel that the global mode is the default is not interesting, choose Local mode to install, execute:
D:\TOOLS\NODEJS>NPM Install Express
After installation, want to look at the installed version, execute:
D:\tools\nodejs>express-v
' Express ' is not an internal or external command, nor is it a running program or batch file.
The problem has come, have to solve Ah! First study, directly find Baidu. Found the answer from the Internet, because the express default installation is the latest version, is already a 4.x.x version. The command tool has been split in the latest version of express4.0+, so you must install Express-generator to perform:
D:\TOOLS\NODEJS>NPM Install Express-generator
Try again: D:\tools\nodejs>express-v ' express ' is not an internal or external command, nor is it a running program or batch file.
Continue Baidu, a lot of netizens have said to configure environment variables, and even some netizens to give examples, after trying are not right. Later found that most of the users in the installation of the use of the global mode (environment variables do not have to make any changes), and then install the express-generator after the no problem. And I am the local mode, how to do? The Netizen almost adopts the global pattern, the local pattern is few and little. There's no way I can only try to find the difference between the global mode and the local mode and the Express command path, Huang Tian, finally found:
Global mode: Install Express and Express-generator after the path:
C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\NPM generates Express, express.cmd two files.
Local mode: Install Express and Express-generator after the path: D:\TOOLS\NodeJs did not generate Express, express.cmd two files. And in the path:
There is a. bin (generated when installing Express-generator) in the D:\TOOLS\NodeJs\node_modules with Express, express.cmd two files.
Consider the local mode to modify environment variables, and when using the Express command with these two files will not have a relationship?. bin is the difference between the two? Then add in the System environment variable path: D:\TOOLS\NodeJs\node_modules\.bin try execution again: d:\tools\nodejs>express-v 4.2.0
It's done, haha! Here to share to everyone, hope to help you!
Reproduced in original: http://blog.csdn.net/mcpang/article/details/26612865
"Node. js" Local mode installation Express: ' Express ' is not an internal or external command, nor is it a running program or batch file.