npm 镜像使用

1、npm安装包时候,报错这个http://..........不能够访问 not accessible 

     或者安装起来很慢,这个是因为要访问国外的网站。 

     npmde 的默认安装源是:http://registry.npmjs.org

 * 解决办法   

   设置其他的源: npm config set registry https://registry.npm.taobao.org

                              npm config get registry

   npm --registry https://registry.npm.taobao.org info underscore

   编辑 .npmrc增加

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

    使用cnpm:npm install -g cnpm --registry=https://registry.......

                      cnpm install ........

几个常用国内镜像:...

    

猜你喜欢

转载自www.cnblogs.com/javagatez/p/13190581.html