npm install 超時 國內 切換源; npm ERR! code ELIFECYCLE;


install 超時

查看npm源地址

npm config get registry

#http://registry.npmjs.org 為國外鏡像地址

設置阿里雲鏡像

npm config set registry http://registry.npm.taobao.org

如果不能解決

npm install --registry=https://registry.npm.taobao.org

重新運行npm命令,解決

npm ERR! code ELIFECYCLE

node_modules的問題,重新安裝

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install  # 很慢
npm run build

另一種設置鏡像的方法

npm install -g cnpm --registry=http://registry.npm.taobao.org 
cnpm -v 
cnpm install


免責聲明!

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



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