2

I'm going through the official react tutorial and wish to use my own text editor; so I followed their instructions and made it all the way to the point where I create my app via "npx create-react-app my-app". Afterwards when I run the command "npm start" I get the following:

(base) Benjamins-MacBook-Pro:my-app solidiquis$ npm start
 my-app@0.1.0 start /Users/solidiquis/Desktop/my-app
 react-scripts start
Attempting to bind to HOST environment variable: x86_64-apple-darwin13.4.0
If this was unintentional, check that you haven't mistakenly set it in your shell.
Learn more here: **omitted
events.js:173
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:26)
Emitted 'error' event at:
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1440:12)    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/solidiquis/.npm/_logs/2019-03-23T20_04_34_120Z-debug.log
(base) Benjamins-MacBook-Pro:my-app solidiquis$ 

I've uninstalled and re-installed node multiples; I've also tried adding a .env file in my project's root directory as described here: npm start on new create-react-app build returns ELIFECYCLE error, but to no avail. Any help would greatly be appreciated!

Benji
  • 29
  • 1
  • 3

2 Answers2

0

Its weird but it works for me

Go to

control panel -->System and Security--> System --> Advanced System Security--> Environment Variables

In Environment Variable popup you will edit the user variable PATH and add "C:\Windows\System32" value as semicolon separated to the existing value.

Not but not least restart the Machine.

enter image description here

Joee
  • 1,104
  • 11
  • 15
-1

For me this was happening because the HOST variable was set to "x86_64-apple-darwin13.4.0". The steps here helped me fix it: https://medium.com/@choy/fixing-create-react-app-when-npm-fails-to-start-because-your-host-environment-variable-is-being-4c8a9fa0b461