npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! network Socket timeout

Viewed 17086

This the error:

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'

I have running: -npm cache clean --force Deleted node_modules and lock-package.json and run npm install but still got me that error

8 Answers

Try this answer

or run npm i -g npm@8.5.1

i think it's an issue with npm version , 8.5.1 solves the problem in most cases

basically try earlier versions and i think the problem will be solved

I faced this problem recently. I tried many solutions like npm cache verify, npm cache clean --force, npm config set fetch-retry-mintimeout, npm config set fetch-retry-maxtimeout, deleting package-lock.json, using different version of npm and/or node.

But the solution that worked for me was to switch to yarn.

mine worked using these steps, hope it works for you too.

  1. npm cache clean --force
  2. npm uninstall -g create-react-app
  3. npm uninstall create-react-app and then
  4. npx create-react-app project-app

if it does not then probably your internet connection is poor or there is a proxy set up error. let me know if it does not work.

I solved this by setting a timeout of 60000 for npm in the .npmrc file. To do that from your terminal, simply do the following:

$ nano .npmrc from your work directory if you want a configuration locally.

Add timeout=60000, save and you're good to go.

Originally posted here: https://github.com/facebook/create-react-app/issues/10251

You can resolve this using YARN package manager. yarn create react-app my-app hope it help.

I am not sure if this will help anyone else, but what appears to have worked for me was dropping my company's VPN connection and reestablishing it!

I faced this error some days ago. I changed the timeout and it works for me. (Note: my npm version is 8.19.1)

For changing the time out, Run these two commands-

npm config set fetch-retry-mintimeout 20000

npm config set fetch-retry-maxtimeout 120000

In my scenario, it was the yarn.lock file availability. So the installer tried to fetch dependencies and threw an error since the response time was delayed. So deleted both yarn.lock and package.lock file and reinstalled after setting npm to npm@8.5.1

Related