需要帮助将angular2 cli项目部署到heroku。我一直在努力做这一整天,遵循10多个教程,每次我成功完成这个命令" git push heroku master",但当我尝试" heroku打开&# 34;它在浏览器中说:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details
这是我的Heroku日志 (我已按照这些说明操作:https://www.angularonrails.com/deploy-angular-cli-webpack-project-heroku/)
2017-02-18T20:24:08.130889+00:00 app[api]: Release v1 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:08.130889+00:00 app[api]: Initial release by user stefanveselinovic@yahoo.com
2017-02-18T20:24:08.256121+00:00 app[api]: Enable Logplex by user stefanveselinovic@yahoo.com
2017-02-18T20:24:08.256121+00:00 app[api]: Release v2 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:08.297332+00:00 app[api]: Release v1 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:08.403518+00:00 app[api]: Release v2 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:32.189771+00:00 app[api]: Scaled to web@1:Free by user stefanveselinovic@yahoo.com
2017-02-18T20:24:32.173943+00:00 app[api]: Deploy a732de8 by user stefanveselinovic@yahoo.com
2017-02-18T20:24:32.173943+00:00 app[api]: Release v3 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:32.543417+00:00 heroku[slug-compiler]: Slug compilation finished
2017-02-18T20:24:32.543411+00:00 heroku[slug-compiler]: Slug compilation started
2017-02-18T20:24:32.524320+00:00 app[api]: Release v3 created by user stefanveselinovic@yahoo.com
2017-02-18T20:24:34.659198+00:00 heroku[web.1]: Starting process with command `npm start`
2017-02-18T20:24:38.349093+00:00 app[web.1]:
2017-02-18T20:24:38.349091+00:00 app[web.1]: > molimte@0.0.0 start /app
2017-02-18T20:24:38.349076+00:00 app[web.1]:
2017-02-18T20:24:38.349092+00:00 app[web.1]: > ng serve
2017-02-18T20:24:38.355237+00:00 app[web.1]: sh: 1: ng: not found
2017-02-18T20:24:38.359792+00:00 app[web.1]:
2017-02-18T20:24:38.367957+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-02-18T20:24:38.368163+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-02-18T20:24:38.368441+00:00 app[web.1]: npm ERR! node v6.9.5
2017-02-18T20:24:38.368678+00:00 app[web.1]: npm ERR! npm v3.10.10
2017-02-18T20:24:38.368871+00:00 app[web.1]: npm ERR! file sh
2017-02-18T20:24:38.369202+00:00 app[web.1]: npm ERR! errno ENOENT
2017-02-18T20:24:38.368995+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-02-18T20:24:38.369431+00:00 app[web.1]: npm ERR! syscall spawn
2017-02-18T20:24:38.369621+00:00 app[web.1]: npm ERR! molimte@0.0.0 start: `ng serve`
2017-02-18T20:24:38.369735+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-02-18T20:24:38.369930+00:00 app[web.1]: npm ERR!
2017-02-18T20:24:38.370254+00:00 app[web.1]: npm ERR! Failed at the molimte@0.0.0 start script 'ng serve'.
2017-02-18T20:24:38.370348+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-02-18T20:24:38.370489+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem withthe molimte package,
2017-02-18T20:24:38.370574+00:00 app[web.1]: npm ERR! not with npm itself.
2017-02-18T20:24:38.370658+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-02-18T20:24:38.370788+00:00 app[web.1]: npm ERR! ng serve
2017-02-18T20:24:38.370929+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-02-18T20:24:38.371011+00:00 app[web.1]: npm ERR! npm bugs molimte
2017-02-18T20:24:38.371094+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get theirinfo via:
2017-02-18T20:24:38.371178+00:00 app[web.1]: npm ERR! npm owner ls molimte
2017-02-18T20:24:38.371262+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-02-18T20:24:38.380133+00:00 app[web.1]:
2017-02-18T20:24:38.380524+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-02-18T20:24:38.380734+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2017-02-18T20:24:38.625964+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-18T20:24:38.627058+00:00 heroku[web.1]: State changed from crashed to starting
2017-02-18T20:24:38.609023+00:00 heroku[web.1]: Process exited with status 1
2017-02-18T20:24:40.588642+00:00 heroku[web.1]: Starting process with command `npm start`
2017-02-18T20:24:43.267853+00:00 heroku[web.1]: Process exited with status 1
2017-02-18T20:24:43.178900+00:00 app[web.1]:
2017-02-18T20:24:43.178919+00:00 app[web.1]: > molimte@0.0.0 start /app
2017-02-18T20:24:43.178920+00:00 app[web.1]: > ng serve
2017-02-18T20:24:43.178921+00:00 app[web.1]:
2017-02-18T20:24:43.184106+00:00 app[web.1]: sh: 1: ng: not found
2017-02-18T20:24:43.191023+00:00 app[web.1]:
2017-02-18T20:24:43.201069+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-02-18T20:24:43.201549+00:00 app[web.1]: npm ERR! node v6.9.5
2017-02-18T20:24:43.200812+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-02-18T20:24:43.201809+00:00 app[web.1]: npm ERR! npm v3.10.10
2017-02-18T20:24:43.202059+00:00 app[web.1]: npm ERR! file sh
2017-02-18T20:24:43.202388+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-02-18T20:24:43.202646+00:00 app[web.1]: npm ERR! errno ENOENT
2017-02-18T20:24:43.202760+00:00 app[web.1]: npm ERR! syscall spawn
2017-02-18T20:24:43.202914+00:00 app[web.1]: npm ERR! molimte@0.0.0 start: `ng serve`
2017-02-18T20:24:43.203054+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-02-18T20:24:43.203212+00:00 app[web.1]: npm ERR!
2017-02-18T20:24:43.203376+00:00 app[web.1]: npm ERR! Failed atthemolimte@0.0.0 start script 'ng serve'.
2017-02-18T20:24:43.203500+00:00 app[web.1]: npm ERR! Make sure you have the latest version of nodejs and npm installed.
2017-02-18T20:24:43.203645+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem withthe molimte package,
2017-02-18T20:24:43.203766+00:00 app[web.1]: npm ERR! not with npm itself.
2017-02-18T20:24:43.203899+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-02-18T20:24:43.204027+00:00 app[web.1]: npm ERR! ng serve
2017-02-18T20:24:43.204155+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-02-18T20:24:43.204284+00:00 app[web.1]: npm ERR! npm bugs molimte
2017-02-18T20:24:43.204417+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get theirinfo via:
2017-02-18T20:24:43.204576+00:00 app[web.1]: npm ERR! npm owner ls molimte
2017-02-18T20:24:43.204698+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-02-18T20:24:43.209496+00:00 app[web.1]:
2017-02-18T20:24:43.209779+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-02-18T20:24:43.209955+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2017-02-18T20:24:43.270970+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-18T20:24:44.788261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-falls-76765.herokuapp.com request_id=ff1d6892-a908-49d0-8d04-85ae44a2a433 fwd="188.2.90.86" dyno= connect= service= status=503 bytes=
2017-02-18T20:24:45.343694+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-falls76765.herokuapp.com request_id=bfeff1ca-177b-4210-be09-69b3d6378421 fwd="188.2.90.86" dyno= connect= service= status=503 bytes=
2017-02-18T20:24:45.460603+00:00 heroku[router]: at=error code=H10 desc="App crahed" method=GET path="/favicon.ico" host=powerful-falls-76765.herokuapp.com request_id=ceb59aa3-7b58-4020-8f2d-4d9414922b2e fwd="188.2.90.86" dyno= connect= service= status=503 bytes=
这是我的package.json文件:
{
"name": "molimte",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "http-server",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"preinstall": "npm install -g http-server",
"postinstall": "ng build && mv dist/* ."
},
"private": true,
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2",
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.26",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "~2.0.3"
},
"devDependencies": {
}
}