Home > front end >  how to solve problem with create-react-app?
how to solve problem with create-react-app?

Time:11-19

npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch 
https://registry.npmjs.org/@typescript-eslint/scope-manager: 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! A complete log of this run can be found in:
npm ERR!     C:\Users\nurlan\AppData\Local\npm-cache\_logs\2021-11-17T07_07_31_258Z-debug.log

CodePudding user response:

Sounds like you have a slow connection. Try increasing the timeout from 30s to 60s by adding this to your .npmrc file:

timeout=60000

You could also try adding

prefer-offline=true

if you are trying to save bandwidth or have a slow connection

Note: if you don't have an .npmrc file setup yet, you can create one here

  • for Windows: C:\Users\{username}\.npmrc
  • for Mac/Linux ~/.npmrc

Or you can create one in the same directory as your project's package.json file.

  • Related