how can I fix this problem npm error to install my react app?

Viewed 2271

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/html-webpack-plugin: 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:

4 Answers

Try clear the cache and install again

npm cache clear --force

npm install

you can try use yarn too.. because it uses backup sources.

i recommande to work with yarn npm install --global yarn yarn create react-app my-app

else you need to clean the cache npm cache clean --force // clean the cache npm cache verify //verify the cache

npx create-react-app my-app // create you react app npm i

My friend I was facing the same problem as me and I found the solution I hope it works out for you First Step : Download Latest Version Of Node Js Second Step : Download Npm Latest Version (Latest Version Important) by npm install -g npm@latest in Cmd Or Terminal Visual Studio Code

Then

Check Of in Cmd Or Terminal Visual Studio Code Any you Want It's Up To You node -v => Should Display Number Represent Node Version npm -v => Should Display Number Represent Npm Version

Then

Write ((npx create-react-app app-name) => Any Name You Want) I hope with all my heart that this solution will work

Related