title: How to resolve Heroku error: Cannot find module 'puppeteer-cluster'?
body: <p>I'm trying to run a single script from my Heroku app. I'm trying to run it on the Heroku server with the following command:</p>
  
  <pre><code>heroku run node path/to/myScript.js
  </code></pre>
  
  <p>This script works perfectly when I run it locally. But I get an error when trying to run it remotely on Heroku.</p>
  
  <p>I expect to see evidence the script ran correctly but instead I get the following error.</p>
  
  <blockquote>
    <p>Error: Cannot find module 'puppeteer-cluster'</p>
  </blockquote>
  
  <p>That dependency is located in my package.json</p>
  
  package.json
  
  <pre><code>  "dependencies": {
      ...
      "puppeteer-cluster": {
        "version": "0.18.0",
        "resolved": "https://registry.npmjs.org/puppeteer-cluster/-/puppeteer-cluster-0.18.0.tgz",
        "integrity": "sha512-xxxxxxxx+xxxxxxxxxxxxxxxxxxxxx==",
        "requires": {
          "debug": "^4.1.1"
        }
      },
      ...
  </code></pre>
  
  <p>What I have tried so far.</p>
  
  <ol>
  <li><p>I tried to make sure I was committing all the new files to git correctly with the following.</p>
  
  <pre><code>git add .
  git commit -m "update"
  git push heroku master
  </code></pre></li>
  <li><p>I tried the following sequence of commands <a href="https://stackoverflow.com/a/45156233">based on this SO answer</a>.</p>
  
  <pre><code>$ heroku config:set NODE_MODULES_CACHE=false
  $ git commit -am 'disable_node_modules_cache' --allow-empty
  $ git push heroku master
  </code></pre></li>
  <li><p>I tried to rebuild and re-deploy my app from scratch as follows.</p>
  
  <pre><code>heroku create my-awesome-app --buildpack heroku/nodejs
  </code></pre></li>
  </ol>
  
  <p>But I got the error:</p>
  
  <blockquote>
    <p>The name my-awesome-app is already taken</p>
  </blockquote>
  
  <ol start="4">
  <li><a href="https://help.heroku.com/TO64O3OG/cannot-find-module-in-node-js-at-runtime" rel="nofollow noreferrer">This page lists the following</a>, which I tried without success.</li>
  </ol>
  
  <blockquote>
    <p><code>heroku config:set NODE_MODULES_CACHE=false</code>
    <br/> Next, you should ensure that you aren't accidentally checking your modules into git.
    <br/> Finally, you should check to ensure that your dependencies are correctly listed in package.json.</p>
  </blockquote>
  
  <ol start="5">
  <li><p>I also tried double checking to make sure I'm not tracking any git files checking the following <a href="https://devcenter.heroku.com/articles/troubleshooting-node-deploys#don-t-check-in-generated-directories" rel="nofollow noreferrer">as suggested here</a>.</p>
  
  <pre><code>git ls-files | grep node_modules
  </code></pre></li>
  <li><p>I added a node version to my package.json after checking the node version I have locally.</p>
  
  <pre><code>node --version
  v12.10.0
  </code></pre></li>
  </ol>
  
  package.json
  
  <pre><code>  "name": "myapp",
    "description": "a really cool app",
    "version": "0.1.0",
    "engines": {
      "node": "12.10.0"
    },
  </code></pre>
  
  <ol start="7">
  <li><a href="https://devcenter.heroku.com/categories/troubleshooting" rel="nofollow noreferrer">I also reviewed the information at this location.</a></li>
  </ol>
  
  <p>What am I doing wrong? And what should I try next?</p>