title: Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import' when deploying a create-react-app
body: <p>I'm new to create-react-app. I just made a quick setup with <code>redux</code> and <code>react-router-dom</code> which builds nicely on my computer using <code>yarn build</code>, but when pushing to Scalingo or Heroku the build fails with the following error:</p>
  <pre><code> ./src/index.jsx
         Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
         Referenced from:
         at Array.forEach (&lt;anonymous&gt;)
         at Array.reduceRight (&lt;anonymous&gt;)
  </code></pre>
  <p>I did not do anything to customize deployment, just pushed to production.</p>
  <p>Here is the full deployment log :</p>
  <pre><code>Enumerating objects: 74, done.
  Counting objects: 100% (74/74), done.
  Delta compression using up to 4 threads
  Compressing objects: 100% (68/68), done.
  Writing objects: 100% (74/74), 185.95 KiB | 4.77 MiB/s, done.
  Total 74 (delta 20), reused 15 (delta 0)
   &lt;-- Start deployment of xxx-app-staging --&gt;
         Fetching source code
  -----&gt; Creating runtime environment
          
         NPM_CONFIG_LOGLEVEL=error
         NPM_CONFIG_PRODUCTION=true
         NODE_VERBOSE=false
         NODE_ENV=production
         NODE_MODULES_CACHE=true
  -----&gt; Installing binaries
         engines.node (package.json):  unspecified
         engines.npm (package.json):   unspecified (use default)
         engines.yarn (package.json):  unspecified (use default)
          
         Resolving node version 8.x...
         Downloading and installing node 8.15.0...
         Using default npm version: 6.4.1
         Resolving yarn version 1.x...
         Downloading and installing yarn (1.14.0)...
         Installed yarn 1.14.0
  -----&gt; Restoring cache
         Skipping cache restore (not-found)
  -----&gt; Building dependencies
         Installing node modules (yarn.lock)
         yarn install v1.14.0
         [1/4] Resolving packages...
         [2/4] Fetching packages...
         info fsevents@1.2.4: The platform &quot;linux&quot; is incompatible with this module.
         info &quot;fsevents@1.2.4&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
         info fsevents@1.2.7: The platform &quot;linux&quot; is incompatible with this module.
         info &quot;fsevents@1.2.7&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
         [3/4] Linking dependencies...
         warning &quot; &gt; eslint-plugin-react@7.12.4&quot; has unmet peer dependency &quot;eslint@^3.0.0 || ^4.0.0 || ^5.0.0&quot;.
         warning &quot;react-scripts &gt; pnp-webpack-plugin &gt; ts-pnp@1.0.0&quot; has unmet peer dependency &quot;typescript@*&quot;.
         warning &quot; &gt; eslint-config-airbnb@17.1.0&quot; has unmet peer dependency &quot;eslint@^4.19.1 || ^5.3.0&quot;.
         warning &quot;eslint-config-airbnb &gt; eslint-config-airbnb-base@13.1.0&quot; has unmet peer dependency &quot;eslint@^4.19.1 || ^5.3.0&quot;.
         warning &quot; &gt; eslint-plugin-import@2.16.0&quot; has unmet peer dependency &quot;eslint@2.x - 5.x&quot;.
         warning &quot; &gt; eslint-plugin-jsx-a11y@6.2.1&quot; has unmet peer dependency &quot;eslint@^3 || ^4 || ^5&quot;.
         [4/4] Building fresh packages...
         Done in 12.22s.
         Running build (yarn)
         yarn run v1.14.0
         $ react-scripts build
         Creating an optimized production build...
         Failed to compile.
          
         ./src/index.jsx
         Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
         Referenced from:
         at Array.forEach (&lt;anonymous&gt;)
         at Array.reduceRight (&lt;anonymous&gt;)
          
          
  error Command failed with exit code 1.
         info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  -----&gt; Build failed
          
         We're sorry this build is failing!
          
         Some possible problems:
          
         - A module may be missing from 'dependencies' in package.json
         http://doc.scalingo.com/languages/javascript/nodejs#ensure-youre-tracking-all-your-dependencies
          
         - This module may be specified in 'devDependencies' instead of 'dependencies'
         http://doc.scalingo.com/languages/javascript/nodejs#install-devdependencies
          
         Keep coding,
         Scalingo
          
   !     An error occured during buildpack compilation
   !   Error deploying the application
   !   → Invalid return code from buildpack 
  </code></pre>
  <p>And here is my <code>package.json</code>:</p>
  <pre><code>{
    &quot;name&quot;: &quot;xxxx&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@sentry/browser&quot;: &quot;^4.5.4&quot;,
      &quot;prop-types&quot;: &quot;^15.7.1&quot;,
      &quot;react&quot;: &quot;^16.8.1&quot;,
      &quot;react-dom&quot;: &quot;^16.8.1&quot;,
      &quot;react-redux&quot;: &quot;^6.0.0&quot;,
      &quot;react-redux-i18n&quot;: &quot;^1.9.3&quot;,
      &quot;react-router-dom&quot;: &quot;^4.3.1&quot;,
      &quot;react-scripts&quot;: &quot;2.1.5&quot;,
      &quot;redux&quot;: &quot;^4.0.1&quot;,
      &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
      &quot;redux-promise&quot;: &quot;^0.6.0&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: &quot;react-app&quot;
    },
    &quot;browserslist&quot;: [
      &quot;&gt;0.2%&quot;,
      &quot;not dead&quot;,
      &quot;not ie &lt;= 11&quot;,
      &quot;not op_mini all&quot;
    ],
    &quot;devDependencies&quot;: {
      &quot;eslint-config-airbnb&quot;: &quot;^17.1.0&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.16.0&quot;,
      &quot;eslint-plugin-jsx-a11y&quot;: &quot;^6.2.1&quot;,
      &quot;eslint-plugin-react&quot;: &quot;^7.12.4&quot;
    }
  }
  </code></pre>
  <p>I can't understand why would I have any usage of <code>eslint</code> and its plugins in my production code, and how to fix this. Can you help?</p>