npm设置淘宝镜像源


淘宝 npm 地址: http://npm.taobao.org/

  1. npm 临时使用
    # 以 events 依赖包为例
    npm --registry https://registry.npmmirror.com install events --save
    
  2. npm 持久使用
    npm config set registry https://registry.npmmirror.com
    
    # 验证:通过以下方式验证结果
    npm config get registry
    
    # 使用:以 events 依赖包为例
    npm install events --save
    
  3. cnpm 使用
    npm install -g cnpm --registry=https://registry.npmmirror.com
    
    # 使用:以 events 依赖包为例
    cnpm install events --save
    

还原 npm 仓库地址:

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM