mac系统安装npm所遇问题


 1、进入node官网,下载mac版node,在安装node时系统会一起安装npm

  默认的 npm registry 会很慢,这时候我们一般改为淘宝的镜像,下面是使用方法: 
  淘宝 npm 地址: http://npm.taobao.org/

  a:临时使用:

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

  b:永久使用:
    npm config set registry https://registry.npm.taobao.org

  配置后可通过下面方式来验证是否成功
    npm config get registry  或  npm info express

  c:通过cnpm使用
    npm install -g cnpm --registry=https://registry.npm.taobao.org

  

 

 

 


免责声明!

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



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