Node.js Heroku构建被拒绝-NodeJS
我正在努力为我的NodeJS应用程序在Heroku上成功执行构建。该应用程序在本地运行,当我将其推送到Heroku时,它运行良好。但随后的推送被Heroku拒绝。这就是我得到的:Node.js Heroku构建被拒绝-NodeJS,node.js,heroku,github,build,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 by
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
我真的搞不懂什么是无法读取未定义属性“0”的意思
编辑:这里是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"
}
}
错误似乎在您的package.json中。 请参阅下面的链接
看来NPM@5.3.0如果已损坏,请尝试降级到5.2错误似乎在您的package.json中。 请参阅下面的链接
看来NPM@5.3.0已损坏尝试降级到5.2我已将其添加到问题中构建依赖项的下一步是heroku开始下载依赖项并记录它。它不存在于您的日志中。你能在你的本地目录下运行npm安装并分析它是否工作正常。这个.npm/_logs/2017-07-28T16_01_18_490Z-debug.log说了什么?我问了很多问题。你能告诉我Git的情况吗。你查到你的最新代码了吗?抓到了!非常感谢!我在package中将5.3.0更改为5.2.0。我已经将其添加到问题中。构建依赖项的下一步是heroku开始下载依赖项并记录它。它不存在于您的日志中。你能在你的本地目录下运行npm安装并分析它是否工作正常。这个.npm/_logs/2017-07-28T16_01_18_490Z-debug.log说了什么?我问了很多问题。你能告诉我Git的情况吗。你查到你的最新代码了吗?抓到了!非常感谢!我在package.json中将5.3.0更改为5.2.0