Node.js npm error message - the system cannot find the path specified

I have a strange error message that I do not understand or cannot get rid of. Secondly, when I try to create an express application on a web server, it cannot find an expression. I am using Windows 7 64 bit.

PS C:\dv> npm -v

The system cannot find the path specified.

 1.2.14 

PS C:\dv>

thank you very much in advance

Jeremiah

+6
source share
3 answers

This is a really old post, but I thought I would share it just in case it helps someone. In my case, the problem was not with npm, but instead with ansicon.

Removing the value of the registry HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun fixes the problem as described in these links ...

https://github.com/cmderdev/cmder/issues/121

The system cannot find the path specified when running the Ruby and Rails command line

+7
source

There was the same problem. Running npm gave me this error:

 C:\Users\user>npm The system cannot find the path specified. 

As a result, I removed nodejs from the control panel and installed a new boot again.

The error does not say that the command could not be found, so I realized that something was wrong with the npm script. The script is located in C: \ Program Files \ nodejs \ npm.cmd found through the var path. echo% path% .

The script contains:

 @IF EXIST "%~dp0\/bin/sh.exe" ( "%~dp0\/bin/sh.exe" "%~dp0\node_modules\npm\bin\npm-cli.js" %* ) ELSE ( /bin/sh "%~dp0\node_modules\npm\bin\npm-cli.js" %* ) 

This didn’t look right, since there are slashes for Windows and there is no sh.exe file where the script wants it. Also there is no / bin / sh file, because its Windows :( That's why it can not find the specified path.

I tried to get node running in cygwin because it is like linux and makes Windows at least somewhat bearable. Perhaps this was a problem?

In any case, after reinstalling the npm.cmd file, it looks like this:

 :: Created by npm, please don't edit manually. @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* ) ELSE ( node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* ) 

Slashes look right and it works.

+1
source

Are you using Cygwin or any other Linux emulation shell as a command line? If this is a possible cause, there may be a known bug with the npm script. Try the proposed solution. here,

fooobar.com/questions/448432 / ...

+1
source

All Articles