Windows system npm "is not an internal or external command" problem

After npm install -g express or npm install -g bower, enter "express --v" or "bower install", it prompts "not an internal or external command".

The solution found in the post bar is "C:\User\username\Appdata\roaming\npm Is there any express.cmd under it, if there is this cmd, it will report an error, reinstall node, if not, add the above folder to path environment variable".
The inspection found that the environment variable path is indeed set to roaming\npm, but there is no express and bower in this directory, and the reinstallation is still invalid.

In desperation, I found my colleague's normal machine to compare the differences one by one, and found that the node_modules corresponding to my colleague's global is also in the roaming\npm directory; and I have set npm config set prefix "E:\nodejs\global", not in the same directory. . Is the executable command generated in the global directory? ! I took a look at my global directory, and sure enough express and express.cmd are in this directory! Quickly changed the path of the environment variable to the corresponding global directory , express --version and press Enter, 3.5.3 came out! !

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324136060&siteId=291194637
Recommended