已解決】github上拉去代碼執行 npm install報錯 code:128 和 Error: EPERM: operation not permitted
背景
npm ERR! code 128 npm ERR! Command failed: git clone --depth=1 -q -b fix/ie-cannot-input-korean git://github.com/sohee-lee7/Squire.git C:\Users\Chocolate\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-b32fd8a4 --config core.longpaths=true npm ERR! warning: templates not found in C:\Users\CHOCOL~1\AppData\Local\Temp\pacote-git-template-tmp\git-clone-1254515c npm ERR! fatal: read error: Invalid argument npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Chocolate\AppData\Roaming\npm-cache\_logs\2020-07-20T02_36_57_452Z-debug.log
解決辦法
執行如下命令:
git config --global http.sslverify "false"
再執行 npm install
就可以了
如果上述命令執行完后,還是報那個錯誤,請繼續執行如下命令,親測有效
git config --global url."https://".insteadOf git://
另一個bug
Error: EPERM: operation not permitted
這個 bug
真是困擾我多年吶,今天終於解決了。主要報錯是自己打開 vscode
,每次執行 npm install
都會說沒權限,后面按照如下方式解決了:
刪除C:\Users\用戶名\.npmrc
文件