Express in local mode: ' Express ' is not an internal or external command, nor is it a running program or batch file.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.