0

My react app when I run 'npm start' gives port busy. Even if a change the port same problem occurs. There's no problem in code as when I created new react app , encountered the same problem. Sudo lsof -i:port gives no process running and other node js app(other than react) is also running perfectly.

sudo nano /etc/hosts/ content is also okay. 127.0.0.1 localhost

Package.json

{
  "name": "app1",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.1"
  },
  "scripts": {
    "start": " react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }
}

1 Answers1

0

Try opening a new terminal and running (assuming port is 3000):

kill $(lsof -t -i:3000)

Then try npm run start again

Pavlos Karalis
  • 2,893
  • 1
  • 6
  • 14