0
{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.1",
    "@testing-library/react": "^12.1.2",
    "@testing-library/user-event": "^13.5.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "web-vitals": "^2.1.2"
  },
  "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"
    ]
  }
}

I am new to learning react. So i wanted to download react router package. When i install the package any version of react router it gives me an error. I tried to uninstall them and npm audit fix but i didn't work.

function App() {
  return (
    <Router>
      <div className="App">
        <Navbar />
        <div className="content">
          <Routes>
              <Route path="/" element={<Home/>}/>                          
            </Routes>
        </div>
      </div>
    </Router>
  );
}

export default App;
Eray Küçük
  • 39
  • 1
  • 1
  • 5
  • 1
    What errors are they? --- React router isn't listed as a dependency --- Move `@testing-library` packages to `devDependencies` as they're only meant for testing, not production. – evolutionxbox Jan 07 '22 at 19:36
  • Just a ton of vulnerabilites. I don't know.Do you know what packages related to react router? Maybe the main issue is packages that version's not fit to react router dom – Eray Küçük Jan 07 '22 at 19:40
  • vulnerabilites is not an error? What command are you running? `react-router-dom` is what's listed on [their website](https://reactrouterdotcom.fly.dev/docs/en/v6/getting-started/tutorial#installation) – evolutionxbox Jan 07 '22 at 19:43
  • I editted the question. I know it hard to read but can you check the terminal output. – Eray Küçük Jan 07 '22 at 19:45
  • Do not worry about `npm audit` output. They're not errors. `npm audit` has nothing to do with react router. – evolutionxbox Jan 07 '22 at 19:46
  • Should it output like "0 vulnerabilites" so i didn't get any error. – Eray Küçük Jan 07 '22 at 19:49
  • I'd say no ([and so do others](https://overreacted.io/npm-audit-broken-by-design/)), since most of the warnings will likely come from your dependencies' dependencies. – evolutionxbox Jan 07 '22 at 19:51
  • [Please follow their tutorial?](https://reactrouterdotcom.fly.dev/docs/en/v6/getting-started/tutorial#installation) – evolutionxbox Jan 07 '22 at 19:55
  • Okay. how can i thank you? is there some "give him like" button :) – Eray Küçük Jan 07 '22 at 19:56
  • Does this answer your question? [Npm install gives warnings, npm audit fix not working](https://stackoverflow.com/questions/53089810/npm-install-gives-warnings-npm-audit-fix-not-working) – evolutionxbox Jan 07 '22 at 19:58
  • it does. Thanks again. – Eray Küçük Jan 07 '22 at 21:00

0 Answers0