when i tried to create a react app using create-react-app im faced with error and unable to create the app.
and the error is….
npm error code EAI_AGAIN
npm error syscall getaddrinfo
npm error errno EAI_AGAIN
npm error request to https://registry.npmjs.org/create-react-app failed, reason: getaddrinfo EAI_AGAIN proxy.example.com
i tried to reinstall node js and clear npm cache but nothing worked.
2
Answers
Source
The most likely issue is that you are on a slow network that causes NPM to timeout. Try this on a different network if you can. Additional turn off any VPN you may be using.
The are a few other things you can try:
Fix dns issue with NPM
Run:
This will remove the NPM proxy.
Flush your dns
Source
On macOS
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
On Windows
ipconfig /flushdns
On Linux
sudo lsof -i :53 -S
The EAI_AGAIN blunders is normally related to DNS research failures. Here are some steps to solve it:
Check Internet Connection: Ensure you have a strong connection.
Change DNS Provider: Switch to Google DNS (8.8.8.Eight, eight.Eight.4.4) or Cloudflare DNS (1.1.1.1).
Clear DNS Cache:
Windows: ipconfig /flushdns
macOS: sudo killall -HUP mDNSResponder
Check Proxy Settings:
Remove proxy settings: npm config delete proxy and npm config delete https-proxy
Try a Different Network: Connect to a exclusive network.
Update npm: npm install -g npm
Use Yarn:
Install Yarn: npm set up -g yarn
Create React app: yarn create react-app my-app
Use npx: npx create-react-app my-app –use-npm
These steps must help you resolve the EAI_AGAIN error and create your React app.