title: heroku requests a library that is already installed
body: <p>I have 1 problem with heroku autobuild</p>
  <p>Stack
  heroku-20</p>
  <pre><code>{
    &quot;name&quot;: &quot;app&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;cross-env next&quot;,
      &quot;build&quot;: &quot;next build&quot;,
      &quot;start&quot;: &quot;cross-env node server.js -p $PORT&quot;
    },
    &quot;engines&quot;: {
      &quot;node&quot;: &quot;16.14.0&quot;,
      &quot;npm&quot;: &quot;8.5.3&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@date-io/date-fns&quot;: &quot;^2.14.0&quot;,
      &quot;@date-io/moment&quot;: &quot;^2.14.0&quot;,
      &quot;@emotion/cache&quot;: &quot;^11.4.0&quot;,
      &quot;@emotion/core&quot;: &quot;^11.0.0&quot;,
      &quot;@emotion/react&quot;: &quot;^11.4.1&quot;,
      &quot;@emotion/server&quot;: &quot;^11.4.0&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.3.0&quot;,
      &quot;@mui/icons-material&quot;: &quot;^5.6.2&quot;,
      &quot;@mui/lab&quot;: &quot;^5.0.0-alpha.80&quot;,
      &quot;@mui/material&quot;: &quot;^5.6.4&quot;,
      &quot;@mui/x-date-pickers&quot;: &quot;^5.0.0-beta.2&quot;,
      &quot;@unly/universal-language-detector&quot;: &quot;^2.0.3&quot;,
      &quot;@zeit/next-css&quot;: &quot;^1.0.1&quot;,
      &quot;axios&quot;: &quot;^0.21.1&quot;,
      &quot;babel-plugin-styled-components&quot;: &quot;^1.12.0&quot;,
      &quot;cookies&quot;: &quot;^0.8.0&quot;,
      &quot;create-emotion-server&quot;: &quot;^11.0.0&quot;,
      &quot;date-fns&quot;: &quot;^2.28.0&quot;,
      &quot;dotenv&quot;: &quot;^8.6.0&quot;,
      &quot;express&quot;: &quot;^4.17.1&quot;,
      &quot;formik&quot;: &quot;^2.2.6&quot;,
      &quot;i18next&quot;: &quot;^19.9.2&quot;,
      &quot;i18next-browser-languagedetector&quot;: &quot;^5.0.1&quot;,
      &quot;i18next-localstorage-cache&quot;: &quot;^1.1.1&quot;,
      &quot;js-cookie&quot;: &quot;^2.2.1&quot;,
      &quot;jwt-decode&quot;: &quot;^2.2.0&quot;,
      &quot;markdown&quot;: &quot;^0.5.0&quot;,
      &quot;moment&quot;: &quot;^2.29.3&quot;,
      &quot;next&quot;: &quot;^10.1.3&quot;,
      &quot;next-cookies&quot;: &quot;^1.1.3&quot;,
      &quot;next-redux-wrapper&quot;: &quot;^4.0.1&quot;,
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react&quot;: &quot;^17.0.2&quot;,
      &quot;react-copy-to-clipboard&quot;: &quot;^5.0.4&quot;,
      &quot;react-dom&quot;: &quot;^17.0.2&quot;,
      &quot;react-i18next&quot;: &quot;^11.10.0&quot;,
      &quot;react-redux&quot;: &quot;^7.2.4&quot;,
      &quot;react-window&quot;: &quot;^1.8.7&quot;,
      &quot;redux&quot;: &quot;^4.1.0&quot;,
      &quot;redux-devtools-extension&quot;: &quot;^2.13.9&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
      &quot;styled-components&quot;: &quot;^4.4.1&quot;,
      &quot;@types/react&quot;: &quot;^17.0.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/plugin-proposal-class-properties&quot;: &quot;^7.13.0&quot;,
      &quot;@babel/plugin-proposal-export-default-from&quot;: &quot;^7.12.13&quot;,
      &quot;@svgr/webpack&quot;: &quot;^5.5.0&quot;,
      &quot;@types/node&quot;: &quot;^12.20.12&quot;,
      &quot;@types/react&quot;: &quot;^17.0.0&quot;,
      &quot;@types/react-dom&quot;: &quot;^16.9.12&quot;,
      &quot;@types/react-redux&quot;: &quot;^7.1.16&quot;,
      &quot;@types/styled-components&quot;: &quot;^5.1.9&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.26.0&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.26.0&quot;,
      &quot;babel-loader&quot;: &quot;8.0.5&quot;,
      &quot;cross-env&quot;: &quot;^7.0.3&quot;,
      &quot;eslint&quot;: &quot;^7.25.0&quot;,
      &quot;eslint-config-airbnb&quot;: &quot;^18.2.1&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.23.4&quot;,
      &quot;eslint-plugin-jsx-a11y&quot;: &quot;^6.4.1&quot;,
      &quot;eslint-plugin-react&quot;: &quot;^7.24.0&quot;,
      &quot;eslint-plugin-react-hooks&quot;: &quot;^4.2.0&quot;,
      &quot;file-loader&quot;: &quot;^6.2.0&quot;,
      &quot;html-webpack-plugin&quot;: &quot;^5.3.1&quot;,
      &quot;husky&quot;: &quot;^6.0.0&quot;,
      &quot;nodemon&quot;: &quot;^2.0.7&quot;,
      &quot;prettier&quot;: &quot;^2.2.1&quot;,
      &quot;ts-node&quot;: &quot;^8.10.2&quot;,
      &quot;tslint&quot;: &quot;^6.1.3&quot;,
      &quot;typescript&quot;: &quot;^4.3.2&quot;,
      &quot;url-loader&quot;: &quot;^4.1.0&quot;,
      &quot;webpack&quot;: &quot;^5.38.1&quot;,
      &quot;webpack-cli&quot;: &quot;^4.7.0&quot;,
      &quot;webpack-dev-middleware&quot;: &quot;^4.1.0&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.2&quot;
    }
  }
  </code></pre>
  <p>The stack is  next.js. Locally, I can build the project. But on heroku it asks for a library @types/react</p>
  <pre><code>-----&gt; Building on the Heroku-20 stack
  -----&gt; Using buildpack: heroku/nodejs
  -----&gt; Node.js app detected
         
  -----&gt; Creating runtime environment
         
         NPM_CONFIG_LOGLEVEL=error
         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)
         
         Resolving node version 16.x...
         Downloading and installing node 16.17.0...
         Using default npm version: 8.15.0
         
  -----&gt; Restoring cache
         Cached directories were not restored due to a change in version of node, npm, yarn or stack
         Module installation may take longer for this build
         
  -----&gt; Installing dependencies
         Installing node modules (package.json)
         
         added 1489 packages, and audited 1490 packages in 1m
         
         160 packages are looking for funding
           run `npm fund` for details
         
         26 vulnerabilities (1 low, 9 moderate, 13 high, 3 critical)
         
         To address issues that do not require attention, run:
           npm audit fix
         
         To address all issues possible (including breaking changes), run:
           npm audit fix --force
         
         Some issues need review, and may require choosing
         a different dependency.
         
         Run `npm audit` for details.
         
  -----&gt; Build
         Running build
         
         &gt; app@1.0.0 build
         &gt; next build
         
         info  - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
         warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
         Attention: Next.js now collects completely anonymous telemetry regarding usage.
         This information is used to shape Next.js' roadmap and prioritize features.
         You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
         https://nextjs.org/telemetry
         
         info  - Checking validity of types...
  It looks like you're trying to use TypeScript but do not have the required package(s) installed.
  Please install @types/react by running:
      npm install --save-dev @types/react
  If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
  -----&gt; Build failed
         
         We're sorry this build is failing! You can troubleshoot common issues here:
         https://devcenter.heroku.com/articles/troubleshooting-node-deploys
         
         Some possible problems:
         
         - Node version not specified in package.json
           https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
         
         Love,
         Heroku
         
   !     Push rejected, failed to compile Node.js app.
   !     Push failed
  </code></pre>
  <p>The same code worked and loaded, builded successfully on August 12. But today (September 13) it stopped building on heroku</p>
  <p>I've tried rebooting, changing version, etc. But it didn't help.</p>
  <p>I tried to upload the old code to heroku, which had already been successfully uploaded earlier, but the error was still the same</p>
  <p>I changed node.js and npm version locally and in package for heroku and that didn't help either</p>