Express installation tip: ' Express ' is not an internal or external command, nor is it a running program or batch file.

Source: Internet
Author: User

When installing express, you need to choose Local mode or global mode, first look at the difference between local mode and global mode:

1. Local mode: NPM install [package_name];

Global mode: NPM [install/i]-G [Package_name]

The difference between the two commands is only that the global mode commands are more-G. Local mode installation does not use Express on the command line because the environment variable is not configured in this mode. If you use global mode, NPM installs the package into the system directory, such as/usr/local/lib/node_modules/, and the files contained in the Bin field in the Package.json file are linked to/usr/local/bin/. /usr/local/bin/is defined by default in the PATH environment variable, so you can run the Supervisor script.js command directly from the command line.

2. Installing in global mode may still not be able to command line direct use Express, because the express default installation is the latest version, is already a 4.x.x version. The command tools are separated from the latest express4.0+ version, so express-generator must be installed.

Perform:

NPM Install Express-generator

After installing the C:\Users\ColdCoder\node_modules, you will find that there is a. bin directory, after which there is a express.cmd file.

After the system environment variable path, add: C:\Users\ColdCoder\node_modules\.bin

This allows you to use express commands directly from the command line.


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.