使用官方命令安装cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装时出错:
- 使用管理员模式运行才cmd:
找到cmd存放目录位置:C:\Windows\System32;
右键以管理员的身份运行;
- 使用FQ、网络代理模式运行
npm install -g cnpm --registry=https://registry.npm.taobao.org
如果以上办法还是不可以;
检查npm中proxy和https-proxy是否不为null或参数错误;
解决方法:
1:将这个两个参数值置为null
检查返回值:
npm config get proxy
npm config get https-proxy
----------
修改值:
npm config set proxy null
npm config set https-proxy null
2:重置registry 参数
npm config set registry http://registry.cnpmjs.org/