三、如何設置npm鏡像


一、臨時使用

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

二、永久使用

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

通過

npm config get registry 查看是否配置成功

npm config list #查看npm當前配置

 
        

或者

編輯 ~/.npmrc 加入下面內容

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

三、通過cnpm使用

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

四、設置回官網

npm config set registry https://registry.npmjs.org

五、強制清理npm的緩存

npm cache clear --force

npm config delete registry npm config delete disturl

四、內網環境搭建私有npm服務

 

 


免責聲明!

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



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