[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