Ira*_*Ira 22 node.js npm-install
这是错误:
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
Run Code Online (Sandbox Code Playgroud)
我跑了npm cache clean --force
删除node_modules并package-lock.json运行npm install但仍然出现该错误
Sup*_*ita 25
几天前我遇到了这个错误。我更改了超时,它对我有用。(注意:我的 npm 版本是8.19.1)
您也可以在其他 npm 版本中尝试此解决方案。
首先,检查当前设置。为了检查当前设置运行npm config ls -l
然后,检查这 4 个值(fetch-retries、fetch-retry-factor、fetch-retry-maxtimeout、fetch-retry-mintimeout、fetch-timeout)
$ npm config ls -l
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
fetch-timeout = 300000
Run Code Online (Sandbox Code Playgroud)
要更改超时,请运行这两个命令 -
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
| 归档时间: |
|
| 查看次数: |
92855 次 |
| 最近记录: |