Today suddenly come to the interest, ready to play Nodejs, install Nodejs time without any problems, all the way next is finished.
Node-v no problem. The version number can be detected, and the node environment ok~
Local mode installation Express framework: NPM Install Express
Detect if the Express is installed successfully: EXPRESS-V
The window prints: ' Express ' is not an internal or external command, nor is it a running program or batch file.
I go, a mouthful of old blood spit, what situation ...
After a few hundred years found, 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 have to install Express-generator, execute: NPM install Express-generator
Continue testing: EXPRESS-V
or print: ' Express ' is not an internal or external command, nor is it a running program or batch file.
What the hell, this thing is a ... Only once again the Valley hundred ...
Valley Result: Configure environment variables. However, the Internet is a global model, many attempts are ineffective, no way, can only look at the global mode and local mode is different.
Global mode:
After installing Express and Express-generator in the path:
C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\NPM generates Express, express.cmd two files.
Local mode:
After installing Express and Express-generator in the path: E:\NodeJs\ path without generating Express, express.cmd two files. And in the path:
There is a. bin (generated when installing Express-generator) in the E:\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 it in the system environment variable path: E:\NodeJs\node_modules\.bin
Test again: express-v
Success! After a long day, only to understand, it is really an egg ache incomparable.
Express in local mode: ' Express ' is not an internal or external command, nor is it a running program or batch file.