5

I would like to use create-react-app, so I follow the instruction:

npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start

But I have error on last step. After running npm start I get error:

Could not find an open port at linux-llw5. Network error message: getaddrinfo ENOTFOUND linux-llw5

How can I fix it?

2 Answers 2

11

Your machine probably has a global HOST environment variable so Create React App tries to find an open port on it instead of the default localhost. Delete the environment variable and it should work fine as you want.

Alternatively you can explicitly change start in scripts in package.json to run HOST=localhost react-scripts start. But this seems a bit complex.

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

1 Comment

what is environment variable and how to delete it?
4

If you set variable in command line and run

...
cd my-app/
HOST=localhost npm start

application should start correctly

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.