Heroku Build Rejected - NodeJS

时间:2017-07-28 16:05:49

标签: node.js heroku github build

我正努力在我的NodeJS应用程序上成功执行Heroku构建。该应用程序在本地工作,当我将其推送到Heroku一旦它工作得很好。但后来的推动被Heroku拒绝了。这就是我得到的:

    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: -----> Node.js app detected
remote: 
remote: -----> 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: -----> 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: -----> Restoring cache
remote:        Loading 2 from cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (not cached - skipping)
remote: 
remote: -----> 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: -----> 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

我真的无法弄清Cannot read property '0' of undefined的含义。

编辑:这是package.json(在本地没有给我任何问题)

{
  "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"
  }
}

1 个答案:

答案 0 :(得分:4)

错误似乎出现在你的package.json中。 请参阅以下链接。

Cannot read property '0' of undefined

似乎NPM@5.3.0已经破坏尝试降级到5.2