Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have installed nodejs. When I try and use npm via power shell or cmd it returns

The system cannot find the path specified.

If I run node -v everything works fine. I can use npm via the nodejs console just fine as well. I've tried uninstalling and reinstalling nodejs multiple times and it didn't help.

Any ideas on what is causing this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.6k views
Welcome To Ask or Share your Answers For Others

1 Answer

For anyone who runs into this trying to debug this error on why npm run <script> doesn't work on Windows for things in node_modules/.bin/ such as gulp, it relates to the fact that npm is using cmd.exe instead of bash for the child.

You can fix this with NPM 5.1.0+ using npm config set script-shell bash


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...