React npm start instead of localhost on windows


So i am trying to launch my react application using instead of localhost.

Here is what i tried:

  1. in scripts i put the following for start

    "start": "set HOST= && react-scripts start"

    This yields following error:

    Attempting to bind to HOST environment variable:
    If this was unintentional, check that you haven't mistakenly set it in your shell.
    Learn more here: 
       throw er; // Unhandled 'error' event
    Error: getaddrinfo ENOTFOUND
     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26)
    Emitted 'error' event on Server instance at:
     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1493:12)
     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:17) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: ' '

I also tried updating my hosts file to have following line:

Note that i can launch in launch.json but that only applies to when i am debugging


So finally figured this out. Created a file called env.local containing following:


Answered By – Maxqueue

Answer Checked By – Katrina (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.