Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm - The system cannot find the path specified

Tags:

node.js

npm

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?

like image 426
Alex Avatar asked Aug 28 '16 10:08

Alex


People also ask

Why does the system Cannot find the path specified?

That's all about how to solve "The system cannot find the path specified." error while running the program from the command prompt. The root cause of this error is invalid directories, sub-directories in the PATH environment variable, just remove them and the error will be solved.

Can write temp file the system Cannot find the path specified?

Solution. Confirm what the Temporary Directory should be. Go to the Atom Management > runtime > Properties > Basic > Temporary Directory. Once confirmed, check the directory exists and can be accessible from the server the runtime is installed on.


1 Answers

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

like image 50
Daniel Ennis - Aikar Avatar answered Sep 19 '22 15:09

Daniel Ennis - Aikar