1

I created a new React App and npm start was working in localhost. After I closed it and went back later npm start will not open in the browser. I reinstalled everything and the exact same thing happened again. I tried installing react-scripts globally. Nope. Same thing. I deleted node_modules and still nothing. I tried removing babel from my package.json. Nothing. I cleared my cache from the browser. Nothing. Any help would be great. I have made many React Apps and never had anything like this.

Here is my package.json:

    {
  "name": "johnny_auth1_app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "bootstrap": "^4.5.3",
    "react": "^17.0.1",
    "react-bootstrap": "^1.4.0",
    "react-dom": "^17.0.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^4.0.1",
    "styled-components": "^5.2.1",
    "web-vitals": "^0.2.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"
    ]
  }
}

Here is my App.js:

import './App.css';
import Home from './Components/Home';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { NavigationBar } from './Components/NavigationBar';

const App = () => {


  return (
    <Router>
      <NavigationBar />
      <div classname='App'>
        
        <Switch>
          <Route exact path='/' component={Home}/>

        </Switch>
      </div>
    </Router>
         
  );
};```
  • Hi! Welcome to StackOverflow! Please read our [tour](https://stackoverflow.com/tour) to get a better understanding about how to add a [*minimal*, *reproducible* example](https://stackoverflow.com/help/minimal-reproducible-example) – 0stone0 Dec 07 '20 at 15:54
  • Does this answer your question? [NPM run \* doesn't do anything](https://stackoverflow.com/questions/59016328/npm-run-doesnt-do-anything) – RobC Dec 07 '20 at 16:10
  • try checking more logs by running npm start --verbose, and check whether already the port is running if you are using cra it will ask for opening in a new port, and you can type y on terminal – Learner Dec 07 '20 at 18:03
  • I think the new version of create-react-app has some major bugs with it (I see their issues about it). Try to install older version of create-react app. – Or Assayag Dec 07 '20 at 18:15
  • I tried everything in what you sent me RobC. Thanks but still no dice. – Johnny Kinnaird Dec 07 '20 at 18:41
  • Also checked that I didn't have something already running on the same port. Thanks however Dileep. – Johnny Kinnaird Dec 07 '20 at 18:42

1 Answers1

-2

This issue may be from the browser you are using. Copy the local host address and past it on different browsers. You may also need to restart your PC if you recently did some installations on the PC.

AnatuGreen
  • 579
  • 7
  • 14