npm使用國內鏡像的方法


一.通過命令配置
1. 命令

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

2. 驗證命令

npm config get registry

如果返回https://registry.npm.taobao.org,說明鏡像配置成功。

 

二、通過使用cnpm安裝
1. 安裝cnpm

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

2. 使用cnpm

cnpm install xxx

 


免責聲明!

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



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