在svn拉取代碼后,npm install 運行項目報錯,錯誤信息如下:
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-05-24T03_13_25_959Z-debug.log
在網上找了跟多方法,比如刪除這個路徑下的日志信息C:\Users\Administrator\AppData\Roaming\npm-cache_logs,試了試,依舊報錯
再比如刪除npm-cache文件夾下的所有文件,結果依舊報錯
報錯信息顯示和git有關,就安裝了git,安裝完之后,依舊報錯,報錯信息變為:
錯誤代碼:128,
說明這個報錯和git相關,又在網上翻閱資料,是開啟了git證書的原因,在git控制台輸入以下命令:git config --global http.sslverify "false",然而並沒有解決問題,最終經過檢查發現我是在桌面上打開的git窗口,沒有在項目路徑下打開窗口,這樣肯定還報錯
