title: npm install --production ignore my dependencies
body: <p>I have this <code>package.json</code>:</p>
  <pre><code>{
      &quot;private&quot;: true,
      &quot;scripts&quot;: {
          &quot;dev&quot;: &quot;npm run development&quot;,
          &quot;development&quot;: &quot;cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js&quot;,
          &quot;watch&quot;: &quot;npm run development -- --watch&quot;,
          &quot;watch-poll&quot;: &quot;npm run watch -- --watch-poll&quot;,
          &quot;hot&quot;: &quot;cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js&quot;,
          &quot;prod&quot;: &quot;npm run production&quot;,
          &quot;production&quot;: &quot;cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js&quot;
      },
      &quot;dependencies&quot;: {
          &quot;cross-env&quot;: &quot;^7.0.3&quot;
      },
      &quot;devDependencies&quot;: {
          &quot;autoprefixer&quot;: &quot;^10.2.6&quot;,
          &quot;axios&quot;: &quot;^0.19&quot;,
          &quot;browser-sync&quot;: &quot;^2.26.14&quot;,
          &quot;browser-sync-webpack-plugin&quot;: &quot;^2.3.0&quot;,
          &quot;cross-env&quot;: &quot;^7.0.3&quot;,
          &quot;laravel-mix&quot;: &quot;^6.0.19&quot;,
          &quot;less&quot;: &quot;^3.13.1&quot;,
          &quot;less-loader&quot;: &quot;^7.3.0&quot;,
          &quot;lodash&quot;: &quot;^4.17.21&quot;,
          &quot;resolve-url-loader&quot;: &quot;^3.1.3&quot;,
          &quot;vue-template-compiler&quot;: &quot;^2.6.14&quot;
      }
  }
  </code></pre>
  <p>Just for testing how do work NodeJS, NPM, Laravel and Laravel Mix (Webpack) together, I run:</p>
  <p><code>npm install --production</code> (<a href="https://docs.npmjs.com/cli/v7/commands/npm-install" rel="nofollow noreferrer">https://docs.npmjs.com/cli/v7/commands/npm-install</a>)</p>
  <blockquote>
  <p>With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.</p>
  </blockquote>
  <h1>Actual behavior</h1>
  <p>When I go to <code>node_modules</code> folder, I don't see any <code>cross-env</code> package there. Moreover the output of the command line is:</p>
  <p><code>$ npm install --production</code></p>
  <blockquote>
  <p>up to date, audited 1 package in 17s</p>
  </blockquote>
  <blockquote>
  <p>found 0 vulnerabilities</p>
  </blockquote>
  <p>, meaning no package (in particular: <code>cross-env</code>) was installed.</p>
  <h1>Expected behavior</h1>
  <p><code>cross-env</code> (and only <code>cross-env</code>) would be installed, being part of <code>dependencies</code>, with this command: <code>npm run install --production</code>.</p>
  <h1>Question</h1>
  <p>Why does <code>dependencies</code> array seem to be ignored by NPM?</p>