核心提示:我的系统是win10专业版64位,在管理员模式的cmd下安装cnpm出现以下报错:解决方案:首先输入以下命令并回车npm set registry https://registry.npm.taoba...
我的系统是win10专业版64位,在管理员模式的cmd下安装cnpm出现以下报错:
解决方案:
首先输入以下命令并回车
npm set registry https://registry.npm.taobao.org # 注册模块镜像 npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 npm cache clean --force # 清空缓存
然后再运行
npm install -g cnpm --registry=https://registry.npm.taobao.org
----这样就ok了。
最后,验证是否成功: 输入命令 cnpm -v。
其他报错解决方案:
1.持久使用
npm config set registry
npm config get registry #配置后可通过下面方式来验证是否成功
2.通过cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org