2013-03-18 1685 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