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缓存干净强制。
仍显示此错误
发布于 2022-02-19 06:33:53
我在节点V16.14.0中遇到了同样的问题,然后我找到了两个解决方案。
使用超时标志
npx创建反应-应用程序客户端-timeout=100000
https://stackoverflow.com/questions/67008920
复制相似问题