Creating a new React app in G:\my-react-projects\dovana.
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template...
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'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\M Monayem Hossain\AppData\Local\npm-cache_logs\2021-12-23T14_13_40_614Z-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 dovana/ from G:\my-react-projects Done.
CodePudding user response:
Try clearing cache and then rerun the setup again
npm cache clean --force
npm install create-react-app
npx create-react-app my-app
CodePudding user response:
try to install anything from NPM to confirm this is an issue with your connection. npm install -g create-react-app. If this (or any other package) succeeds, it may be other issue.
Consider as well it could be an issue with npx on your machine. Try installing it using create-react-app directly instead by first installing it globally (like I showed above)
Also try this
npm config set registry http://registry.npmjs.org/
and this
npm set timeout=100000
CodePudding user response:
can you set the npm timeout value to a longer time:
Step 1:
Can you create a local file called .npmrc In the folder set the value for timeout to be:timeout=100000
or
Run the following:
npm set timeout=100000
Step 2:
Finally run the following set of commands:
npm cache clean --force
npm install create-react-app
npx create-react-app ./