I am running Windows 7. I have encountered this before and solved it like this. I hope it will be useful. Add NODE_PATH to the environment variable
C:UsersxxxAppDataRoamingnpm Then add %NODE_PATH%
at the end of PATH
Under Windows, I also encountered the problem that the command could not be executed after express was installed. Just tried it, express-generator can be successful. Thanks.
npm install -g express-generator
https://cnodejs.org/topic/51dc1383d44cbfa304181253
Please make good use of search engines.
When I read "Node.js Classic Introduction" again today, I installed express through npm according to the textbook,
express -g express
Run the command line again
express express_example
When I tried, I reported the error "express is not an internal or external command". Later, I searched on Google for a solution: It turns out that the default express installation is the latest version, which is already version 4.x.x. In the latest express4.0+ version, the command tool is separated, so express-generator must be installed. The solution is to execute the command line:
npm install -g express-generator
Wait until the installation is completed, and then express -vtest whether the installation is successful~ It is usually no problem, unless you first installed express locally instead of "-g". In that case, You can refer to here
https://cnodejs.org/topic/51dc1383d44cbfa304181253
Please make good use of search engines.
How to install
express
?If you want to use the module from the command line, you need to install it globally.
Try
npm install -g express
and run the express commandWhen I read "Node.js Classic Introduction" again today, I installed express through npm according to the textbook,
Run the command line again
When I tried, I reported the error "express is not an internal or external command". Later, I searched on Google for a solution:
It turns out that the default express installation is the latest version, which is already version 4.x.x. In the latest express4.0+ version, the command tool is separated, so express-generator must be installed. The solution is to execute the command line:
Wait until the installation is completed, and then
express -v
test whether the installation is successful~It is usually no problem, unless you first installed express locally instead of "-g". In that case, You can refer to here