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

569

被折叠的 条评论
为什么被折叠?



