Search code examples
node.jsreactjscreate-react-app

Error while trying to create react app using npm


I'm trying to creating react app using create-react-app command but I get this error message:

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/dotenv-expand: 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'

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

I tried to clean cache:

npm cache clean -f

I also tried restarting the computer and reinstall nodejs and npm, but nothing was fixed.

Can anyone know what is the issue? and how can I solve it?


Solution

  • After more than 3 days of working on this error, I found the solution and fixed the problem by install another version of Nodejs. The current version was v16.14.0 when I got this error. And now it's v16.0.0 and everything's is work just fine.