1

I was installing the React.js and i got this error.

I installed react app but i found this ERR.`

PS D:\Other\Youtube Channels\Design,tuts and motivational  channels\Code with harry\Website course\Test folder> npx create-react-app my-react-app 

Creating a new React app in D:\Other\Youtube Channels\Design,tuts and motivational  channels\Code with harry\Website course\Test folder\my-react-app.

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

npm ERR! code FETCH_ERROR 
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/@typescript-eslint%2feslint-plugin reason: Invalid response body while trying to fetch https://registry.npmjs.org/@typescript-eslint%2feslint-plugin: Socket timeout

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\amanullah\AppData\Local\npm-cache\_logs\2022-12-15T09_57_58_961Z-debug-0.log

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

Deleting generated file... package.json
Deleting my-react-app/ from D:\Other\Youtube Channels\Design,tuts and motivational  channels\Code with harry\Website course\Test folder
Done.
PS D:\Other\Youtube Channels\Design,tuts and motivational  channels\Code with harry\Website course\Test folder> 

I seen some yt videos and even the stackoverflow conversations, but i did not found any answers.

I was expecting to install react app in folder of files for website.But i got error

1 Answers1

0

This is due to socket timeout, in other words, your network is too slow to download the resources or taking too much time and it is throwing an error. You could fix this issue by resetting the timeout duration.

Either reset the minimum timeout:

npm config set fetch-retry-mintimeout 100000 // time in milliseconds

Or reset the maximum timeout:

npm config set fetch-retry-maxtimeout 200000 // time in milliseconds
Haneen Mahdin
  • 1,000
  • 1
  • 7
  • 13