'npx create-react-app my-app ERROR "In most cases you are behind a proxy..."
Error when using npx create-react-app my-app
. I'm new in node
and react
and I'm trying to create my first react app. I seem to have fairly good internet connection.
I tried npx create-react-app my-app
6 times but it's having the same error:
user@Acer:~/ReactProjects$ npx create-react-app my-app
Creating a new React app in /home/user/ReactProjects/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ETIMEDOUT
npm ERR! syscall read
npm ERR! errno ETIMEDOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/@babel%2fplugin-proposal-async-generator-functions: read ETIMEDOUT
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! /home/user/.npm/_logs/2022-03-06T11_34_36_543Z-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 my-app/ from /home/user/ReactProjects
Done.
user@Acer:~/ReactProjects$
I am running this on windows 10
build 19044
using vscode
with remote wsl extension
which connects to my ubuntu-20.04
on wsl2
.
I want to create my first react app
.
What should I do from here?
Solution 1:[1]
Sometimes i got same error when not connected with network or poor network connection.
Solution 2:[2]
try to update npm using npm install -g npm@latest --force
Solution 3:[3]
I had the same issue this Error occurred because you are using proxy server to connect internet if so stopping using proxy will solve it but if you want to keep up with proxy follow this first clear cache
npm cache clear --force
second:
npm config set registry http://registry.npmjs.org/
third:
npm install -g create-react-app
last:
create-react-app appName
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Harsh Mangalam |
Solution 2 | Ashwin Kumar |
Solution 3 | dilbro |