npm 安装失败,并显示“error-ex@^1.3.1”不在 npm 注册表中

2023-12-11

npm 安装失败并出现以下错误:

⠼ 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 声誉,我无法发表评论,并且我对包含此详细信息的问题的编辑被社区拒绝并显示以下消息

此编辑旨在针对该帖子的作者,作为编辑没有任何意义。它应该写成评论或答案。

Visting https://registry.npmjs.org/error-ex & https://registry.npmjs.com/error-ex给出了 cloudflare 404 错误页面。

访问 npm 注册表镜像https://skimdb.npmjs.com/error-ex给出一个 json 响应,但由于 tarball 链接来自https://registry.npmjs.org/将注册表设置为镜像后,npm install 失败,url 为 cloudflare 404https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz

尝试了几个互联网连接,因为问题似乎出在 cloudflare 上。当我通过浏览器和 wget 尝试时,我尝试的互联网连接之一给了我正确的 json 响应。但仍然npm install失败的。

最后通过使用互联网连接手动下载上面的 tarball 使其工作,这给了我正确的结果,然后将其添加到 npm 缓存中

npm cache add <link_to_the_tarball>

注意:尽管这解决了这个特定问题。还有其他软件包也存在同样的问题。所以,最后我结束了安装npm_lazy(http://mixu.net/npm_lazy/)用作我的存储库。手动添加失败的项目,例如error-ex to the npm_lazy通过编辑 json 文件进行缓存。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

npm 安装失败,并显示“error-ex@^1.3.1”不在 npm 注册表中 的相关文章

随机推荐