title: In React：Module not found: Can't resolve 'react-router-dom'
body: <p><a href="https://i.stack.imgur.com/u4Po6.png" rel="noreferrer">enter image description here</a>
  <a href="https://i.stack.imgur.com/PfVxI.png" rel="noreferrer">enter image description here</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import * as React from 'react';
  import Root from './Root';
  import './App.css'
  import {session} from './libs/session';
  import {Redirect} from "react-router-dom";
  
  export default class App extends React.Component {
  
      public componentWillMount() {
          console.log("componentWillMount App");
      }
  
      public componentDidMount() {
          console.log("componentDidMount App");
          console.log(window.location.search.replace(/\?/g,''));
          const urlParmes = window.location.search.replace(/\?/g,'');
          session.token = urlParmes.replace(/^token=/g,'');
      }
  
  
    public render() {
        if (session.token === '' || session.token === null || session.token === 'undefined') {
            console.log('no Jurisdiction');
            return (&lt;Redirect to='/'/&gt;);
        } else {
            console.log('has Jurisdiction')
        }
      return (
        &lt;div className="App"&gt;
          &lt;Root /&gt;
        &lt;/div&gt;
      )
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>My purpose is to detect 'token' and then redirect it to the login page.
  this  is why? please help me.  Thanks</p>