如何修复`npm install`上包的超时? [英] How to fix timeout for packages on `npm install`?

查看:171
本文介绍了如何修复`npm install`上包的超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 npm install 时,它似乎工作正常,直到部分安装软件包.前半部分好像没有问题,但是过一段时间就无法访问其他包了.我只是得到重复的错误,例如:

When I run npm install it seems to work fine until part way installing packages. It seems to have no problem with the first half, but then after a while it will fail to be able to reach other packages. I just get the repeating errors, eg:

npm http request GET https://registry.npmjs.org/react-hot-loader
npm info attempt registry request try #3 at 6:43:34 AM
npm http request GET https://registry.npmjs.org/react-tap-event-plugin
npm info attempt registry request try #3 at 6:43:34 AM
npm http request GET https://registry.npmjs.org/react-test-renderer

它将继续执行此操作一个小时,然后安装将失败.

It will continue to do this for an hour and and then the install will fail.

每次安装都会在不同的包中中断,所以我认为这不是特定文件的问题.

The install breaks at a different package each time so I don't think it's a problem with a particular file.

我可以使用浏览器和 curl 正常访问这些文件.

I can access these files fine with my browser and curl.

我的工作有防火墙,但此域已列入白名单.

My work has a firewall but this domain is whitelisted.

有谁知道我能做些什么来让它发挥作用或可能导致它的原因是什么?

Would anyone know what I could do to get this to work or what could be causing it?

推荐答案

如果是关于时间问题,你应该找到 npm install 的速度解决方案.

If it's about the timing problem you should find a speed solutions for npm install.

所以你可以试试这些比 npm install 更快的命令:

So you can try these faster command than npm install :

pnpm install %70 快

npm install --no-audit 快 15%

npm install --prefer-offline --no-audit 快 15%

pnpm install %70 faster
or
npm install --no-audit 15% faster
or
npm install --prefer-offline --no-audit 15% faster

查看这篇文章了解详情:加速 npm 安装

check this article for details : speeding up npm install

这篇关于如何修复`npm install`上包的超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆