我的系统是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 https://registry.npm.taobao.org
npm config get registry #配置后可通过下面方式来验证是否成功
2.通过cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
解决Win10下cnpm安装问题
本文介绍了解决Windows 10环境下使用管理员模式cmd安装cnpm时遇到的问题及解决方案,包括设置镜像源、清理缓存等步骤,并提供了验证安装是否成功的命令。
2541





