npm安装失败,npm注册表中没有“ error-ex@^1.3.1”

时间:2020-02-12 01:29:33

标签: npm npm-install

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.

1 个答案:

答案 0 :(得分:0)

好吧,我不知道如何添加此附加信息,因为我没有50的声誉,因此无法发表评论,而我对带有此详细信息的问题的编辑被社区拒绝,并显示消息

此编辑旨在解决该帖子的作者,并且没有任何意义。它应该被写为评论或答案。

绕过https://registry.npmjs.org/error-exhttps://registry.npmjs.com/error-ex会出现cloudflare 404错误页面。

https://skimdb.npmjs.com/error-ex访问npm注册表镜像会给出一个json响应,但是由于tarball链接来自https://registry.npmjs.org/ npm安装,因此将注册表设置为镜像后失败,URL {{3 }}

尝试了几个Internet连接,因为问题似乎与cloudflare有关。通过浏览器和wget尝试时,我尝试过的互联网连接之一为我提供了正确的json响应。但是npm install仍然失败。

最后通过使用互联网连接手动下载上述tarball使其正常工作,然后通过

将其添加到npm缓存中,从而使其正常工作

npm cache add <link_to_the_tarball>

注意:尽管这解决了此特定问题。还有其他具有相同问题的软件包。因此,最后我最终安装了npm_lazyhttps://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz)用作我的存储库。通过编辑json文件,将失败的项目(如error-ex手动添加到npm_lazy缓存中。