Vue項目Vue element admin 啟動報錯 C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-05-24T03_13_25_959Z-debug.log【已解決】


在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窗口,沒有在項目路徑下打開窗口,這樣肯定還報錯

於是就在項目路徑下打開git窗口,輸入以下命令:git config --global http.sslverify "false",終於node_modules文件夾出現了,運行完之后,沒有報錯!!!趕緊npm run dev,項目運行成功了!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM