首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >npm错误!代码ERR_SOCKET_TIMEOUT npm错误!errno ERR_SOCKET_TIMEOUT

npm错误!代码ERR_SOCKET_TIMEOUT npm错误!errno ERR_SOCKET_TIMEOUT
EN

Stack Overflow用户
提问于 2021-04-08 17:20:38
回答 1查看 2.4K关注 0票数 2
代码语言:javascript
复制
Creating a new React app in /home/abhijith/Desktop/React/firstReact/myapp.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! request to https://registry.npmjs.org/find-cache-dir failed, reason: Socket timeout

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abhijith/.npm/_logs/2021-04-08T17_06_38_087Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting myapp/ from /home/abhijith/Desktop/React/firstReact
Done.

i尝试过sudo npm更新npm -g,npm缓存干净强制。

仍显示此错误

EN

回答 1

Stack Overflow用户

发布于 2022-02-19 06:33:53

我在节点V16.14.0中遇到了同样的问题,然后我找到了两个解决方案。

  1. 为弱internet连接

使用超时标志

npx创建反应-应用程序客户端-timeout=100000

  1. 将我的nodejs版本从16.14.0降至16.0.0。在16.0.0版中,我没有面对这个问题。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67008920

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档