使用淘宝镜像(cnpm)安装依赖包

镜像使用方法(4种办法任意一种都能解决问题):

1.通过config命令

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

npm info underscore (如果上面配置正确这个命令会有字符串response)

2.通过install命令 

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

 这样就可以使用 cnpm 命令来安装模块了:   

 cnpm install [name]

3.命令行指定

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

4.编辑~/.npmrc加入下面内容

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

你可能感兴趣的:(使用淘宝镜像(cnpm)安装依赖包)