cnpm安装错误npm ERR! code ENOLOCAL

本文解决了一个常见的npm安装错误:npm ERR! code ENOLOCAL,当尝试从registry=https: egistry.npm.taobao.org安装包但未找到package.json文件时出现。通过使用命令npm cache clean --force清空npm缓存,再重新运行安装命令即可解决问题。

"registry=https:\registry.npm.taobao.org" as it does not contain a package.json file.

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

npm ERR! code ENOLOCAL npm ERR! Could not install from "registry=https:\registry.npm.taobao.org" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:

 

本想安装一个cnpm的,结果一直报错npm ERR! code ENOLOCAL,"registry=https:\registry.npm.taobao.org" as it does not contain a package.json file.

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

到最后发现只要清空一下缓存就好了!

npm cache clean --force

再输入安装命令就可以了

npm install -g cnpm --registry=https://registry.npm.taobao.org
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值