Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm start stopped working on react project

I've been working on a project using React.js It used to work fine on localhost:3000 but suddenly this has stopped working. The commands I did before was

  • sudo npm run bundle
  • sudo npm start

And then my project was running. But now it says localhost refused connection. Message in the console:

"Failed to load resource: net::ERR_CONNECTION_REFUSED". Any ideas why?

  • I have checked that localhost:3000 not occupied
  • I have checked that Im working in the correct folder and all files seems * to be present
  • I have checked that Im using the latest npm and node version
like image 578
Nicklas Gilbertsson Avatar asked Jul 10 '26 11:07

Nicklas Gilbertsson


1 Answers

You don't say what OS you are using but if it is MacOS or Linux you might want to check what $HOST is set to.

See How to start a react app with a custom host and port

like image 132
ADG Avatar answered Jul 15 '26 01:07

ADG