我一直在尝试将我的 AngularFullstack(节点)应用程序部署到 Heroku。我在终端中创建了应用程序:yo angular-fullstack
. 每当我尝试部署到 Heroku 时,当我转到已部署的应用程序时,都会得到以下信息:
应用程序错误
应用程序发生错误,无法提供您的页面。请稍后重试。
如果您是应用程序所有者,请查看您的日志以获取详细信息。
日志是:
2015-07-24T06:57:35.184227+00:00 heroku[web.1]: State changed from up to starting
2015-07-24T06:57:38.772056+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-07-24T06:57:39.757747+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2015-07-24T06:57:40.645233+00:00 heroku[web.1]: Process exited with status 22
2015-07-24T06:57:49.314501+00:00 heroku[web.1]: Starting process with command `npm start`
2015-07-24T06:57:51.176323+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-07-24T06:57:51.176346+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-07-24T06:57:51.863498+00:00 app[web.1]: > startup@0.0.0 start /app
2015-07-24T06:57:51.863492+00:00 app[web.1]:
2015-07-24T06:57:51.863500+00:00 app[web.1]: > node server/app.js
2015-07-24T06:57:51.863501+00:00 app[web.1]:
2015-07-24T06:57:52.919124+00:00 app[web.1]: npm ERR! Linux 3.13.0-57-generic
2015-07-24T06:57:52.926086+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-07-24T06:57:52.926206+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-07-24T06:57:52.852124+00:00 app[web.1]: fs.js:0
2015-07-24T06:57:52.852131+00:00 app[web.1]: (function (exports, require, module, __filename, __dirname) { // Copyright Joy
2015-07-24T06:57:52.852132+00:00 app[web.1]:
2015-07-24T06:57:52.852133+00:00 app[web.1]: Error: ENOENT, no such file or directory '/app/public/favicon.ico'
2015-07-24T06:57:52.852135+00:00 app[web.1]: at Error (native)
2015-07-24T06:57:52.852136+00:00 app[web.1]: at Object.fs.statSync (fs.js:797:18)
2015-07-24T06:57:52.852137+00:00 app[web.1]: at favicon (/app/node_modules/serve-favicon/index.js:47:15)
2015-07-24T06:57:52.852139+00:00 app[web.1]: at module.exports (/app/server/config/express.js:32:13)
2015-07-24T06:57:52.852140+00:00 app[web.1]: at Object.<anonymous> (/app/server/app.js:35:28)
2015-07-24T06:57:52.852141+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-07-24T06:57:52.852142+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2015-07-24T06:57:52.852144+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-07-24T06:57:52.852143+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-07-24T06:57:52.852146+00:00 app[web.1]: at Function.Module.runMain (module.js:501:10)
2015-07-24T06:57:52.893865+00:00 app[web.1]:
2015-07-24T06:57:52.919677+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-07-24T06:57:52.919919+00:00 app[web.1]: npm ERR! node v0.12.7
2015-07-24T06:57:52.920832+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-07-24T06:57:52.920669+00:00 app[web.1]: npm ERR! npm v2.11.3
2015-07-24T06:57:52.921015+00:00 app[web.1]: npm ERR! startup@0.0.0 start: `node server/app.js`
2015-07-24T06:57:52.921148+00:00 app[web.1]: npm ERR! Exit status 1
2015-07-24T06:57:52.921496+00:00 app[web.1]: npm ERR! Failed at the startup@0.0.0 start script 'node server/app.js'.
2015-07-24T06:57:52.921314+00:00 app[web.1]: npm ERR!
2015-07-24T06:57:52.921680+00:00 app[web.1]: npm ERR! This is most likely a problem with the startup package,
2015-07-24T06:57:52.922108+00:00 app[web.1]: npm ERR! node server/app.js
2015-07-24T06:57:52.921833+00:00 app[web.1]: npm ERR! not with npm itself.
2015-07-24T06:57:52.921968+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-07-24T06:57:52.922254+00:00 app[web.1]: npm ERR! You can get their info via:
2015-07-24T06:57:52.922518+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-07-24T06:57:52.922373+00:00 app[web.1]: npm ERR! npm owner ls startup
2015-07-24T06:57:52.925618+00:00 app[web.1]:
2015-07-24T06:57:53.972027+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-24T06:57:53.972984+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-24T06:57:53.956209+00:00 heroku[web.1]: Process exited with status 1
2015-07-24T06:58:17.709969+00:00 heroku[web.1]: Starting process with command `npm start`
2015-07-24T06:58:20.882672+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-07-24T06:58:20.898495+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-07-24T06:58:22.481040+00:00 app[web.1]:
2015-07-24T06:58:22.481045+00:00 app[web.1]: > startup@0.0.0 start /app
2015-07-24T06:58:22.481047+00:00 app[web.1]: > node server/app.js
2015-07-24T06:58:22.481048+00:00 app[web.1]:
2015-07-24T06:58:23.526831+00:00 app[web.1]: npm ERR! Linux 3.13.0-49-generic
2015-07-24T06:58:23.502777+00:00 app[web.1]: fs.js:0
2015-07-24T06:58:23.502783+00:00 app[web.1]: (function (exports, require, module, __filename, __dirname) { // Copyright Joy
2015-07-24T06:58:23.502785+00:00 app[web.1]:
2015-07-24T06:58:23.502786+00:00 app[web.1]: Error: ENOENT, no such file or directory '/app/public/favicon.ico'
2015-07-24T06:58:23.502791+00:00 app[web.1]: at favicon (/app/node_modules/serve-favicon/index.js:47:15)
2015-07-24T06:58:23.502788+00:00 app[web.1]: at Error (native)
2015-07-24T06:58:23.502789+00:00 app[web.1]: at Object.fs.statSync (fs.js:797:18)
2015-07-24T06:58:23.502792+00:00 app[web.1]: at module.exports (/app/server/config/express.js:32:13)
2015-07-24T06:58:23.502793+00:00 app[web.1]: at Object.<anonymous> (/app/server/app.js:35:28)
2015-07-24T06:58:23.502795+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2015-07-24T06:58:23.502794+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-07-24T06:58:23.502797+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-07-24T06:58:23.502798+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-07-24T06:58:23.502799+00:00 app[web.1]: at Function.Module.runMain (module.js:501:10)
2015-07-24T06:58:23.521999+00:00 app[web.1]:
2015-07-24T06:58:23.527299+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-07-24T06:58:23.527497+00:00 app[web.1]: npm ERR! node v0.12.7
2015-07-24T06:58:23.527870+00:00 app[web.1]: npm ERR! npm v2.11.3
2015-07-24T06:58:23.528052+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-07-24T06:58:23.528208+00:00 app[web.1]: npm ERR! startup@0.0.0 start: `node server/app.js`
2015-07-24T06:58:23.528350+00:00 app[web.1]: npm ERR! Exit status 1
2015-07-24T06:58:23.528500+00:00 app[web.1]: npm ERR!
2015-07-24T06:58:23.528642+00:00 app[web.1]: npm ERR! Failed at the startup@0.0.0 start script 'node server/app.js'.
2015-07-24T06:58:23.529501+00:00 app[web.1]: npm ERR! not with npm itself.
2015-07-24T06:58:23.529998+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-07-24T06:58:23.529302+00:00 app[web.1]: npm ERR! This is most likely a problem with the startup package,
2015-07-24T06:58:23.530188+00:00 app[web.1]: npm ERR! node server/app.js
2015-07-24T06:58:23.530706+00:00 app[web.1]: npm ERR! You can get their info via:
2015-07-24T06:58:23.530887+00:00 app[web.1]: npm ERR! npm owner ls startup
2015-07-24T06:58:23.531127+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-07-24T06:58:23.533571+00:00 app[web.1]:
2015-07-24T06:58:23.533831+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-07-24T06:58:23.534025+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2015-07-24T06:58:24.420694+00:00 heroku[web.1]: Process exited with status 1
2015-07-24T06:58:24.435391+00:00 heroku[web.1]: State changed from starting to crashed
起初我认为这是我的 favicon 的问题,但在移动它并修改了一些服务器/配置文件之后,我尝试上传一个不同的 AngularFullstack 应用程序,我已经成功地将它放在 Heroku 上。当我尝试重新上传它时,它会产生完全相同的错误,即使我可以在它自己的 Heroku 应用程序上更新它。我还尝试创建其他 Heroku 应用程序,以防有问题的应用程序已损坏,但我仍然遇到相同的错误。这让我觉得我尝试上传到 Heroku 的方式有问题。
考虑到这一点,以下是我尝试部署到 Heroku 的步骤:
$ cd dir
$ heroku login
$ heroku git:remote -a nameOfApp
$ git init
$ git add .
$ git add -A
$ git commit -m "doesntMatter"
$ git push -f heroku