title: Trying to deploy my react app on Netlify which I created on a local host, but get an error while trying to deploy
body: <p>I have created a react app on my localhost and pushed it through my repository of github, but now that I wanna deploy it on Netlify I get this error. Here is part of the log which consist some errors. plzzzzzzzz help me :(. By the way the code runs smoothly on the localhost.</p>
  <pre><code>7:50:52 PM:   1. Build command from Netlify app                             
  7:50:52 PM: ────────────────────────────────────────────────────────────────
  7:50:52 PM: ​
  7:50:52 PM: $ npm run build
  7:50:52 PM: &gt; project@0.1.0 build /opt/build/repo
  7:50:52 PM: &gt; react-scripts build
  7:50:54 PM: Creating an optimized production build...
  7:50:56 PM: Failed to compile.
  7:50:56 PM: 
  7:50:56 PM: ./src/App.js
  7:50:56 PM: Cannot find module: 'react-router-dom'. Make sure this package is installed.
  7:50:56 PM: You can install this package by running: yarn add react-router-dom.
  7:50:56 PM: npm ERR! code ELIFECYCLE
  7:50:56 PM: npm ERR! errno 1
  7:50:56 PM: npm ERR! project@0.1.0 build: `react-scripts build`
  7:50:56 PM: npm ERR! Exit status 1
  7:50:56 PM: npm ERR!
  7:50:56 PM: npm ERR! Failed at the project@0.1.0 build script.
  7:50:56 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  7:50:56 PM: npm ERR! A complete log of this run can be found in:
  7:50:56 PM: npm ERR!     /opt/buildhome/.npm/_logs/2021-07-08T15_20_56_695Z-debug.log
  7:50:56 PM: ​
  7:50:56 PM: ────────────────────────────────────────────────────────────────
  7:50:56 PM:   &quot;build.command&quot; failed                                        
  7:50:56 PM: ────────────────────────────────────────────────────────────────
  7:50:56 PM: ​
  7:50:56 PM:   Error message
  7:50:56 PM:   Command failed with exit code 1: npm run build
  7:50:56 PM: ​
  7:50:56 PM:   Error location
  7:50:56 PM:   In Build command from Netlify app:
  7:50:56 PM:   npm run build
  7:50:56 PM: ​
  7:50:56 PM:   Resolved config
  7:50:56 PM:   build:
  7:50:56 PM:     command: npm run build
  7:50:56 PM:     commandOrigin: ui
  7:50:56 PM:     publish: /opt/build/repo/build
  7:50:56 PM:     publishOrigin: ui
  7:50:56 PM:   functions:
  7:50:56 PM:     '*': {}
  7:50:57 PM: Caching artifacts
  7:50:57 PM: Started saving node modules
  7:50:57 PM: Finished saving node modules
  7:50:57 PM: Started saving build plugins
  7:50:57 PM: Finished saving build plugins
  7:50:57 PM: Started saving yarn cache
  7:50:57 PM: Finished saving yarn cache
  7:50:57 PM: Started saving pip cache
  7:50:57 PM: Finished saving pip cache
  7:50:57 PM: Started saving emacs cask dependencies
  7:50:57 PM: Finished saving emacs cask dependencies
  7:50:57 PM: Started saving maven dependencies
  7:50:57 PM: Finished saving maven dependencies
  7:50:57 PM: Started saving boot dependencies
  7:50:57 PM: Finished saving boot dependencies
  7:50:57 PM: Started saving rust rustup cache
  7:50:57 PM: Finished saving rust rustup cache
  7:50:57 PM: Started saving go dependencies
  7:50:57 PM: Finished saving go dependencies
  7:51:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
  7:51:00 PM: Creating deploy upload records
  7:51:00 PM: Failing build: Failed to build site
  7:51:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
  7:51:00 PM: Finished processing build request in 54.583388691s
  </code></pre>