npm - npm 安装失败,“error-ex@^1.3.1”不在 npm 注册表中
问题描述
npm install 失败并出现以下错误:
⠼ Installing packages...npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/error-ex
npm ERR! 404
npm ERR! 404 'error-ex@^1.3.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'parse-json'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
解决方案
好吧,我不知道如何添加此附加信息,因为由于没有 50 名声望,我无法发表评论,并且我对带有此详细信息的问题的编辑被社区拒绝并带有消息
此编辑旨在解决帖子的作者,作为编辑毫无意义。它应该写成评论或答案。
访问https://registry.npmjs.org/error-ex和https://registry.npmjs.com/error-ex会给出 cloudflare 404 错误页面。
在https://skimdb.npmjs.com/error-ex访问 npm 注册表镜像会给出 json 响应,但由于 tarball 链接来自https://registry.npmjs.org/将注册表设置为镜像后 npm install 失败使用 cloudflare 404 作为 URL https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz
尝试了几个互联网连接,因为问题似乎与 cloudflare 有关。当通过浏览器和 wget 尝试时,我尝试的其中一个互联网连接给了我正确的 json 响应。但还是npm install
失败了。
最后通过使用 Internet 连接手动下载上述 tarball 来使其正常工作,这给了我正确的结果,然后将其添加到 npm 缓存中
npm cache add <link_to_the_tarball>
注意:虽然这解决了这个特定问题。其他软件包也有同样的问题。所以,最后我最终安装npm_lazy
(http://mixu.net/npm_lazy/)作为我的存储库。通过编辑 json 文件手动将失败的项目添加error-ex
到缓存中。npm_lazy
推荐阅读
- php - Laravel-PHP 请求未正确设置数据库值
- javascript - 如何在Angular 6中将材料日期选择器日期值格式化为“MM-DD-YYY”格式?
- php - 如何通过php pdo中的foreach循环从myslq表中获取所有行
- typescript - 没有 3rd 方库的类型安全错误处理
- android - 无法在索引 33 处解析文本
- java - log4j2 - 为特定包配置标准错误重定向/忽略
- r - 为什么在使用 knitr 在 R Markdown 中运行代码时与在 R 脚本中运行代码时得到不同的结果
- oracle - Get time and number of OBIEE 12c users login
- css - 如何为大孩子 sibebar 菜单添加背景颜色?
- javascript - 如何渲染不同颜色的点?