npm使用國內淘寶鏡像的方法


一. 通過命令配置

  1. 命令
npm config set registry https://registry.npm.taobao.org

  1. 驗證命令
npm config get registry

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

二、通過使用 cnpm 安裝

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

  1. 使用 cnpm
cnpm install xxx


免責聲明!

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



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