npm install出錯的解決辦法
很多小伙伴可能跟我一樣是個小白,還不知道怎么啟動vue,然后就照着README一陣亂搞,然后npm install的時候就報了以下的錯誤,網上的解決辦法也看不懂,我自己的解決辦法來了。
it <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s). npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart() npm ERR! path git npm ERR! code ENOENT npm ERR! errno ENOENT npm ERR! syscall spawn git 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.
解決辦法是這樣的:
不要直接在vscode的命令行中執行npm install,而是進入你項目所在的目錄下,啟動命令行窗口,然后在這里輸入npm install,就可以了,等待它install完成以后,就去啟動你的vue,完成。如果不行的大,大家可以先執行 npm cache clean --force 清除緩存,然后再執行npm install即可。
原文鏈接:vue 項目npm install 報錯 npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Sq