Npm start and getting "Unable to connect" error in react?

I'm getting error of Unable to connect while running npm start command in react js. How to resolve this error and why is it comming.

If you have installed react, node npm and setup other required stuffs however getting error of "Unable to connect" in browser when you run the command "npm start".  Browser opens with the URL "http://localhost:3000/" and shows "Unable to connect" then you can resolve this problem by running below commands in terminal (I'm using Ubuntu 16.04):

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288

 

Both of the above commands are really nice to help you in resolving the issue of unable to connect. Hope you get the correct solution.