title: Deploy Node.js on Heroku Error: ! [remote rejected] master -> master (pre-receive hook declined)
body: <p>I am receiving the following error when trying to deploy a React app on Heroku. I have moved <code>node_modules</code> to <code>.gitignore</code>, set the Heroku nodejs buildpack, and updated to the latest versions of node and npm ensuring they match my engines list in <code>package.json</code>. I cannot figure out what is causing this</p>
  
  <pre><code>Enumerating objects: 29163, done.
  Counting objects: 100% (29163/29163), done.
  Delta compression using up to 4 threads
  Compressing objects: 100% (21337/21337), done.
  Writing objects: 100% (29163/29163), 31.64 MiB | 711.00 KiB/s, done.
  Total 29163 (delta 6397), reused 29163 (delta 6397)
  remote: Compressing source files... done.
  remote: Building source:
  remote: 
  remote: -----&gt; Node.js app detected
  remote:        
  remote: -----&gt; Creating runtime environment
  remote:        
  remote:        NPM_CONFIG_LOGLEVEL=error
  remote:        NODE_ENV=production
  remote:        NODE_MODULES_CACHE=true
  remote:        NODE_VERBOSE=false
  remote:        
  remote: -----&gt; Installing binaries
  remote:        engines.node (package.json):  12.16.1
  remote:        engines.npm (package.json):   6.4.1
  remote:        
  remote:        Resolving node version 12.16.1...
  remote:        Downloading and installing node 12.16.1...
  remote:        Bootstrapping npm 6.4.1 (replacing 6.13.4)...
  remote:        npm 6.4.1 installed
  remote:        
  remote: -----&gt; Installing dependencies
  remote:        Prebuild detected (node_modules already exists)
  remote:        Rebuilding any native modules
  remote:        
  remote:        &gt; core-js-pure@3.6.4 postinstall /tmp/build_b4eb2781076772d39a0d97bcbfa078c6/node_modules/core-js-pure
  remote:        &gt; node -e "try{require('./postinstall')}catch(e){}"
  remote:        
  remote:        
  remote:        &gt; core-js@3.6.4 postinstall /tmp/build_b4eb2781076772d39a0d97bcbfa078c6/node_modules/core-js
  remote:        &gt; node -e "try{require('./postinstall')}catch(e){}"
  remote:        
  remote:        
  remote:        &gt; core-js@2.6.11 postinstall /tmp/build_b4eb2781076772d39a0d97bcbfa078c6/node_modules/babel-runtime/node_modules/core-js
  remote:        &gt; node -e "try{require('./postinstall')}catch(e){}"
  remote:        
  remote:        Installing any new modules (package.json)
  remote:        audited 930385 packages in 17.403s
  remote:        found 0 vulnerabilities
  remote:        
  remote:        
  remote: -----&gt; Build
  remote:        Running build
  remote:        
  remote:        &gt; project-x@0.1.0 build /tmp/build_b4eb2781076772d39a0d97bcbfa078c6
  remote:        &gt; react-scripts build
  remote:        
  remote:        Creating an optimized production build...
  remote:        Failed to compile.
  remote:        
  remote:        ./src/SocialFollow.js
  remote:        Cannot find module: '@fortawesome/react-fontawesome'. Make sure this package is installed.
  remote:        
  remote:        You can install this package by running: npm install @fortawesome/react-fontawesome.
  remote:        
  remote:        
  remote: npm ERR! code ELIFECYCLE
  remote: npm ERR! errno 1
  remote: npm ERR! project-x@0.1.0 build: `react-scripts build`
  remote: npm ERR! Exit status 1
  remote: npm ERR! 
  remote: npm ERR! Failed at the project-x@0.1.0 build script.
  remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  remote: 
  remote: npm ERR! A complete log of this run can be found in:
  remote: npm ERR!     /tmp/npmcache.ce7js/_logs/2020-03-25T00_48_13_911Z-debug.log
  remote: 
  remote: -----&gt; Build failed
  remote:        
  remote:        We're sorry this build is failing! You can troubleshoot common issues here:
  remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
  remote:        
  remote:        Some possible problems:
  remote:        
  remote:        - node_modules checked into source control
  remote:          https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
  remote:        
  remote:        - A module may be missing from 'dependencies' in package.json
  remote:          https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies
  remote:        
  remote:        Love,
  remote:        Heroku
  remote:        
  remote:  !     Push rejected, failed to compile Node.js app.
  remote: 
  remote:  !     Push failed
  remote: Verifying deploy...
  remote: 
  remote: !   Push rejected to hidden-stream-53835.
  remote: 
  To https://git.heroku.com/hidden-stream-53835.git
   ! [remote rejected]   master -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'https://git.heroku.com/hidden-stream-53835.git'
  </code></pre>
  
  <p><code>package.json</code></p>
  
  <pre><code>{
    "name": "project-x",
    "version": "0.1.0",
    "private": true,
    "engines": {
      "npm": "6.4.1",
      "node": "12.16.1"
    },
    "dependencies": {
      "@testing-library/jest-dom": "^4.2.4",
      "@testing-library/react": "^9.5.0",
      "@testing-library/user-event": "^7.2.1",
      "react": "^16.13.1",
      "react-dom": "^16.13.1",
      "react-scripts": "3.4.1"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
    },
    "eslintConfig": {
      "extends": "react-app"
    },
    "browserslist": {
      "production": [
        "&gt;0.2%",
        "not dead",
        "not op_mini all"
      ],
      "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version"
      ]
    }
  }
  </code></pre>