0

I would like to install ReactJs. I have installed Nodejs then try to create ReactJs project folder, I use
npx create-react-app my-app as per ReactJs documentation But this is the error which I get:-

npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz failed, reason: getaddrinfo ENOTFOUND proxy.company.com
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!     ..\_logs\2020-12-22T14_02_16_883Z-debug.log
6
  • Check your config: reason: getaddrinfo ENOTFOUND proxy.company.com Commented Dec 22, 2020 at 14:30
  • There are multiple hits when searching for the error... Commented Dec 22, 2020 at 14:30
  • how to solve reason: getaddrinfo ENOTFOUND proxy.company.com @szczocik Commented Dec 22, 2020 at 14:39
  • what do you get when you run this: npm config get proxy Commented Dec 22, 2020 at 14:41
  • I get :- null @szczocik Commented Dec 22, 2020 at 14:44

4 Answers 4

1

Go to

C:\Users\username

and then Search

.npmrc

Open .npmrc file with Notepad and Delete everything and past

http_proxy=http://domain:8080

This Works For me.

Sign up to request clarification or add additional context in comments.

Comments

0

Based on this line in the error message:

npm ERR! network request to https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz failed, reason: getaddrinfo ENOTFOUND proxy.company.com

...you have proxy.company.com set as your proxy somewhere. Find that and fix it to the setting you actually need or else remove it if you need no proxy (which is the standard/typical case). In the latter case, use npm config delete proxy and then try to install.

Perhaps you were following the instructions at https://jjasonclark.com/how-to-setup-node-behind-web-proxy/ or a related tutorial that uses proxy.company.com in its examples.

Comments

0

I was setting proxy as

npm config set http_proxy=http://domain:8080

instead of using the correct way

npm config set proxy http://domain:8080

e.g: npm config set proxy http://123.01.2.

If you're using windows you can find the domain address in the control panel> Network and internet >internet options > click connections tab > Lan settings. You should see your proxy address

Comments

0

Use a different (Wi-Fi) network or a mobile hotspot. Then try again to create the react app:

npx create-react-app <project_name>

This works for me, hope it helps you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.