[Node. js] An error is reported during the test during the installation of express: 'express 'is not an internal or external command, or a program or batch file that can be run ., Node. jsexpress

Source: Internet
Author: User

[Node. js] An error is reported during the test during the installation of express: 'express 'is not an internal or external command, or a program or batch file that can be run ., Node. jsexpress

When installing the express framework of the Framework, follow the book in the node. js guide to install express in global and local modes.
Run the cdm command window and install it using the command line:

npm install -g express

After the installation is complete, run the following command to test whether the installation is successful:

express --help 

Error message: 'express 'is not an internal or external command, or a program or batch file that can be run.
Then I started Baidu and found out the answer from the Internet, because express is installed with the latest version by default, which is already version 4.x. x. The latest express4.0 + version separates the command tool, so you must install express-generator and execute:
D: \ TOOLS \ NodeJs> npm install express-generator
Try again:
D: \ TOOLS \ NodeJs> express-V
'Express 'is not an internal or external command, or a program or batch file that can be run.
Then, I will continue to look for the location of the Self-installed express? Then install the command line with the installation location. You can check the installation address on your own. The installation address is C: \ Users \ allen_shao \ node_modules.bin. If not, reinstall it, it will be displayed, and then I tried to configure the environment variables, which is consistent with the idea of configuring the environment variables before java, then add my express address to the Path, and then try again, successful.

C:\Users\allen_shao>express -V;  Usage: express [options] [dir]  Options:        --version        output the version number    -e, --ejs            add ejs engine support        --pug            add pug engine support        --hbs            add handlebars engine support    -H, --hogan          add hogan.js engine support    -v, --view <engine>  add view <engine> support (dust|ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)    -c, --css <engine>   add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)        --git            add .gitignore    -f, --force          force on non-empty directory    -h, --help           output usage information  error: unknown option `-V'
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Http://blog.csdn.net/u011958281/article/details/79207912

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.