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.
source share