'React js application isn't running on localhost:3000

I have tried many many times but my http://localhost:3000 not working at all.

Just taking reload & reload

Console log is also clear. nothing at there.

1st time when I faced this problem, I cleared the history, then it works but now this is not working,

After giving so much pressure, it shows me,"

Aw, Snap!

something went wrong while displaying this webpage. 

"

my app.js file:

import './App.css';

function App() {
  return (
    <div className="App">

      <h1>Hello World</h1>

    </div>
  );
}

export default App;

my package.json file:

{
  "name": "secret-name",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.1.1",
    "@testing-library/user-event": "^13.5.0",
    "bootstrap": "^5.1.3",
    "react": "^18.1.0",
    "react-bootstrap": "^2.3.1",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Just the title of my website appears at the top.

I can't create a new react app because this is an assignment and I have pushed the primary code to the private repository. I don't want more problems.

After facing this problem, I deleted the package.lock.json & node_modules and then again install the packages by npm install.

What can I do now?



Solution 1:[1]

I think that something went wrong when you create the project. Try to create a new one

npx create-react-app my_app_name

And the run

npm run start

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TheKritsakon