skip to Main Content

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


  1. According to [the] Microsoft Docs EAI_AGAIN error code translate to temporary failure in name resolution, that is a DNS issue.

    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:

    npm config rm proxy 
    npm config rm https-proxy 
    

    This will remove the NPM proxy.

    Flush your dns

    DNS flushing is the process of clearing the Domain Name System (DNS) cache on your device. Most devices store records retrieved from DNS servers in their cache to avoid repeat queries in the future.

    Source

    On macOS

    1. Open the terminal
    2. Run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

    On Windows

    1. Open CMD as an adminstrator
    2. Run ipconfig /flushdns

    On Linux

    1. Open the terminal
    2. Run sudo lsof -i :53 -S
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search