2013-03-18 1678 views

回答

1

非常感谢有同样的问题。运行NPM给了我这个错误:

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

我结束了卸载从控制面板和的NodeJS用新鲜的下载重新安装。

该错误并没有说它找不到命令,所以我觉得这是npm脚本的错误。该脚本位于C:\ Program Files \ nodejs \ npm.cmd,通过路径var找到。 echo%path%

脚本包含:

@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" %* 
) 

这好像有问题,因为有正斜杠适用于Windows和在脚本希望它是没有sh.exe文件。也没有/斌/ sh文件,因为它的Windows :(这就是为什么它找不到指定的路径。

我试图让节点在cygwin工作,因为它类似于Linux,并使Windows至少有点忍受也许这是问题

反正以后重新安装npm.cmd文件看起来像:?

:: 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" %* 
) 

的斜线看的权利和它的作品

7

这是一个非常古老的职位,但我想我会分享以防万一它可以帮助别人。在我的情况下,问题不是npm,而是ansicon。

删除注册表项HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun的值解决了问题,如这些链接中所述...

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

The system cannot find the path specified when starting Ruby and Rails command prompt

+0

非常感谢,卸载/重新安装什么也没做,但是这个工作对我来说,以及(Windows10)! – tsf144 2016-11-29 04:20:00

+0

非常感谢!我安装了ConEmu,后来卸载了它,这是抛出'.. can not find path ..'错误。删除修复它! – Breakpoint 2017-03-27 05:37:06

+0

答案解决了我的问题,以及8/14/2017。不知道在哪里,为什么或如何'ansicon'最终安装在我的机器上。 – JoeManFoo 2017-08-14 15:08:29