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

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

node.js - npm - The system cannot find the path specified

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...