title: Heroku Build Rejected - NodeJS
body: <p>I'm struggling to successfully execute a build on Heroku for my NodeJS app. The app works locally, when I push it to Heroku once it works great. But the subsequent pushes are being rejected by Heroku. This is what I get:</p>
  
  <pre><code>    Counting objects: 15, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (12/12), done.
  Writing objects: 100% (15/15), 1.34 KiB | 0 bytes/s, done.
  Total 15 (delta 7), reused 0 (delta 0)
  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:        NPM_CONFIG_PRODUCTION=true
  remote:        NODE_VERBOSE=false
  remote:        NODE_ENV=production
  remote:        NODE_MODULES_CACHE=true
  remote: 
  remote: -----&gt; Installing binaries
  remote:        engines.node (package.json):  7.10.0
  remote:        engines.npm (package.json):   5.3.0
  remote:        
  remote:        Resolving node version 7.10.0...
  remote:        Downloading and installing node 7.10.0...
  remote:        Bootstrapping npm 5.3.0 (replacing 4.2.0)...
  remote:        npm 5.3.0 installed
  remote: 
  remote: -----&gt; Restoring cache
  remote:        Loading 2 from cacheDirectories (default):
  remote:        - node_modules
  remote:        - bower_components (not cached - skipping)
  remote: 
  remote: -----&gt; Building dependencies
  remote:        Installing node modules (package.json)
  remote:        npm ERR! Cannot read property '0' of undefined
  remote:        
  remote:        npm ERR! A complete log of this run can be found in:
  remote:        npm ERR!     /app/.npm/_logs/2017-07-28T16_01_18_490Z-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:        If you're stuck, please submit a ticket so we can help:
  remote:        https://help.heroku.com/
  remote:        
  remote:        Love,
  remote:        Heroku
  remote:        
  remote:  !     Push rejected, failed to compile Node.js app.
  remote: 
  remote:  !     Push failed
  </code></pre>
  
  <p>I really can't figure out what that <code>Cannot read property '0' of undefined</code> means.</p>
  
  <p>EDIT: Here is the package.json (which doesn't give me any problems locally)</p>
  
  <pre><code>{
    "name": "truffle-init-webpack",
    "description": "Frontend example using truffle v3",
    "scripts": {
      "lint": "eslint ./",
      "build": "webpack",
      "dev": "webpack-dev-server"
    },
    "engines": {
      "node": "7.10.0",
      "npm": "5.3.0"
    },
    "author": "Douglas von Kohorn",
    "license": "MIT",
    "dependencies": {
      "babel-cli": "^6.22.2",
      "babel-core": "^6.22.1",
      "babel-eslint": "^6.1.2",
      "babel-loader": "^6.2.10",
      "babel-plugin-transform-runtime": "^6.22.0",
      "babel-preset-env": "^1.1.8",
      "babel-preset-es2015": "^6.22.0",
      "babel-register": "^6.22.0",
      "copy-webpack-plugin": "^4.0.1",
      "css-loader": "^0.26.1",
      "eslint": "^3.14.0",
      "eslint-config-standard": "^6.0.0",
      "eslint-plugin-babel": "^4.0.0",
      "eslint-plugin-mocha": "^4.8.0",
      "eslint-plugin-promise": "^3.0.0",
      "eslint-plugin-standard": "^2.0.0",
      "html-webpack-plugin": "^2.28.0",
      "json-loader": "^0.5.4",
      "style-loader": "^0.13.1",
      "truffle-contract": "^1.1.6",
      "web3": "^0.18.2",
      "webpack": "^2.2.1",
      "webpack-dev-server": "^2.3.0"
    }
  }
  </code></pre>