title: Failed to compile. Module not found: Can't resolve 'react-router-dom'
body: <p>After <code>npm start</code>, the browser gives the error: </p>
  
  <blockquote>
    <p>Failed to compile ./src/components/App/App.js Module not found: Can't resolve 'react-router-dom'.</p>
  </blockquote>
  
  <p>React-router-dom has been added to the dependencies in npm and so has react-router and react. </p>
  
  <p>Project has been created using the <code>create-react-app myapp</code> cmd line. This is runned on a localhost, node server. I have an api and app folder inside my project folder. I have tried various things. Updated manually my package.json inside the app folder, reinstalled react-router-dom, delete the package-lock.json in the app folder and reinitialize it. My api folder holds nothing but node_modules, my api file, route.js, config.js, index.js and also a package.json and package-lock.json. I have tried the npm build command in my app folder. It just creates a 'build' folder which holds the same files as my public folder inside my app folder. I also tried running <code>yarn add react-router-dom</code>.</p>
  
  <pre><code>//=========App.js file=========
  
  //dependencies
  import React, { Component } from 'react';
  import { BrowserRouter as Router, Route } from 'react-router-dom';
  
  //components
  import Header from '../Header/Header';
  import Footer from '../Footer/Footer';
  import Home from '../Pages/Home';
  import StudentOverview from '../Pages/StudentOverview';
  import StudentDetails from '../Pages/StudentDetails';
  import Management from '../Pages/Management';
  import StudentAdd from '../Pages/StudentAdd';
  import Exercise from '../Exercise/Exercise';
  
  //includes
  import '../../../public/css/kdg-fonts.css';
  import '../../../public/css/normalize.css';
  import '../../../public/css/responsive.css';
  import '../../../public/css/say-my-name.css';
  import '../../../public/css/style.css';
  
  //Run
  class App extends Component {
    render() {
      return (
        &lt;Router&gt;
          &lt;div className="App"&gt;
            &lt;Route path='*' component={Header} /&gt;
            &lt;Route path='*' component={Footer} /&gt;
            &lt;Route exact path='/' component={Home} /&gt;
            &lt;Route exact path='/studenten' component={StudentOverview} /&gt;
            &lt;Route exact path='/studenten/:id' component={StudentDetails} /&gt;
            &lt;Route exact path='/beheer' component={Management} /&gt;
            &lt;Route exact path='/beheer/add' component={StudentAdd} /&gt;
            &lt;Route exact path='/oefenen' component={Exercise} /&gt;
          &lt;/div&gt;
        &lt;/Router&gt;
      );
    }
  }
  
  export default App;
  
  //=========appfolder/package.json file=========
  
  {
    "name": "saymyname",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "react": "^16.7.0",
      "react-dom": "^16.7.0",
      "react-scripts": "2.1.1"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": [
      "&gt;0.2%",
      "not dead",
      "not ie &lt;= 11",
      "not op_mini all"
    ],
    "devDependencies": {
      "gulp": "^4.0.0",
      "gulp-changed": "^3.2.0",
      "gulp-clean-css": "^4.0.0",
      "gulp-rename": "^1.4.0",
      "gulp-sass": "^4.0.2",
      "gulp-uglify": "^3.0.1"
    }
  }
  </code></pre>
  
  <blockquote>
    <p>UPDATE: <code>npm install -S react-router-dom</code> resolved the error.</p>
  </blockquote>