在Heroku上部署的应用无法打开

时间:2018-07-23 10:04:03

标签: node.js heroku

我已经在Heroku上部署了我的应用程序,但是在打开由Heroku创建的url时出现错误消息,并且该应用程序无法打开。 错误消息是: 应用程序错误-应用程序中发生错误,无法提供您的页面。如果您是应用程序所有者,请检查日志以了解详细信息。

我还检查了日志。日志文件的内容为:

2018-07-22T19:15:27.574151+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-22T19:15:27.574496+00:00 app[web.1]: npm ERR! errno ENOENT
2018-07-22T19:15:27.574845+00:00 app[web.1]: npm ERR! syscall spawn
2018-07-22T19:15:27.577071+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `nodejs ./bin/www`
2018-07-22T19:15:27.577258+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-07-22T19:15:27.577608+00:00 app[web.1]: npm ERR!
2018-07-22T19:15:27.577820+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2018-07-22T19:15:27.578010+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-22T19:15:27.593094+00:00 app[web.1]: 
2018-07-22T19:15:27.593319+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-22T19:15:27.593479+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-07-22T19_15_27_579Z-debug.log
2018-07-22T19:15:27.678271+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-22T20:21:57.714867+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-22T20:22:02.401778+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-22T20:22:06.011345+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-22T20:22:05.990282+00:00 heroku[web.1]: Process exited with status 1
2018-07-22T20:22:05.753929+00:00 app[web.1]: 
2018-07-22T20:22:05.753947+00:00 app[web.1]: > application-name@0.0.1 start /app
2018-07-22T20:22:05.753949+00:00 app[web.1]: > nodejs ./bin/www
2018-07-22T20:22:05.753950+00:00 app[web.1]: 
2018-07-22T20:22:05.772532+00:00 app[web.1]: sh: 1: nodejs: not found
2018-07-22T20:22:05.786592+00:00 app[web.1]: npm ERR! file sh
2018-07-22T20:22:05.786899+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-22T20:22:05.787218+00:00 app[web.1]: npm ERR! errno ENOENT
2018-07-22T20:22:05.787494+00:00 app[web.1]: npm ERR! syscall spawn
2018-07-22T20:22:05.789357+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `nodejs ./bin/www`
2018-07-22T20:22:05.789540+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-07-22T20:22:05.789806+00:00 app[web.1]: npm ERR!
2018-07-22T20:22:05.790007+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2018-07-22T20:22:05.790201+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-22T20:22:05.905092+00:00 app[web.1]: 
2018-07-22T20:22:05.905306+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-22T20:22:05.905564+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-07-22T20_22_05_792Z-debug.log
2018-07-22T22:48:56.854101+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-22T22:48:59.513390+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-22T22:49:02.328816+00:00 heroku[web.1]: Process exited with status 1
2018-07-22T22:49:02.348913+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-22T22:49:02.195195+00:00 app[web.1]: 
2018-07-22T22:49:02.195215+00:00 app[web.1]: > application-name@0.0.1 start /app
2018-07-22T22:49:02.195216+00:00 app[web.1]: > nodejs ./bin/www
2018-07-22T22:49:02.195218+00:00 app[web.1]: 
2018-07-22T22:49:02.200430+00:00 app[web.1]: sh: 1: nodejs: not found
2018-07-22T22:49:02.204284+00:00 app[web.1]: npm ERR! file sh
2018-07-22T22:49:02.204652+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-22T22:49:02.204864+00:00 app[web.1]: npm ERR! errno ENOENT
2018-07-22T22:49:02.205009+00:00 app[web.1]: npm ERR! syscall spawn
2018-07-22T22:49:02.206235+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `nodejs ./bin/www`
2018-07-22T22:49:02.206335+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-07-22T22:49:02.206512+00:00 app[web.1]: npm ERR!
2018-07-22T22:49:02.206628+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2018-07-22T22:49:02.206734+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-22T22:49:02.215606+00:00 app[web.1]: 
2018-07-22T22:49:02.215841+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-22T22:49:02.215990+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-07-22T22_49_02_208Z-debug.log
2018-07-23T01:49:47.449731+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-23T01:49:51.282257+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-23T01:49:54.944257+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-23T01:49:54.925415+00:00 heroku[web.1]: Process exited with status 1
2018-07-23T01:49:54.774610+00:00 app[web.1]: 
2018-07-23T01:49:54.774632+00:00 app[web.1]: > application-name@0.0.1 start /app
2018-07-23T01:49:54.774634+00:00 app[web.1]: > nodejs ./bin/www
2018-07-23T01:49:54.774635+00:00 app[web.1]: 
2018-07-23T01:49:54.788087+00:00 app[web.1]: sh: 1: nodejs: not found
2018-07-23T01:49:54.792162+00:00 app[web.1]: npm ERR! file sh
2018-07-23T01:49:54.792529+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-23T01:49:54.792807+00:00 app[web.1]: npm ERR! errno ENOENT
2018-07-23T01:49:54.793018+00:00 app[web.1]: npm ERR! syscall spawn
2018-07-23T01:49:54.795021+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `nodejs ./bin/www`
2018-07-23T01:49:54.795536+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-07-23T01:49:54.795539+00:00 app[web.1]: npm ERR!
2018-07-23T01:49:54.795698+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2018-07-23T01:49:54.795889+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-23T01:49:54.824742+00:00 app[web.1]: 
2018-07-23T01:49:54.824747+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-23T01:49:54.824748+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-07-23T01_49_54_797Z-debug.log
2018-07-23T07:30:51.946392+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-23T07:30:55.838495+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-23T07:31:00.097602+00:00 heroku[web.1]: Process exited with status 1
2018-07-23T07:31:00.119097+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-23T07:30:59.946434+00:00 app[web.1]: 
2018-07-23T07:30:59.946461+00:00 app[web.1]: > application-name@0.0.1 start /app
2018-07-23T07:30:59.946463+00:00 app[web.1]: > nodejs ./bin/www
2018-07-23T07:30:59.946465+00:00 app[web.1]: 
2018-07-23T07:30:59.973944+00:00 app[web.1]: sh: 1: nodejs: not found
2018-07-23T07:30:59.986041+00:00 app[web.1]: npm ERR! file sh
2018-07-23T07:30:59.986559+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-23T07:30:59.986975+00:00 app[web.1]: npm ERR! errno ENOENT
2018-07-23T07:30:59.987479+00:00 app[web.1]: npm ERR! syscall spawn
2018-07-23T07:30:59.991145+00:00 app[web.1]: npm ERR! application-name@0.0.1 start: `nodejs ./bin/www`
2018-07-23T07:30:59.991616+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-07-23T07:30:59.992161+00:00 app[web.1]: npm ERR!
2018-07-23T07:30:59.992660+00:00 app[web.1]: npm ERR! Failed at the application-name@0.0.1 start script.
2018-07-23T07:30:59.993101+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-23T07:31:00.019197+00:00 app[web.1]: 
2018-07-23T07:31:00.019783+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-23T07:31:00.020262+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-07-23T07_30_59_996Z-debug.log
2018-07-23T09:43:24.528826+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shielded-ravine-63121.herokuapp.com request_id=904cc6eb-8ced-4fba-8168-e053ff311437 fwd="122.15.87.170" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T09:43:24.898029+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shielded-ravine-63121.herokuapp.com request_id=b11efeb6-4628-4b5d-a34e-60523ff0b267 fwd="122.15.87.170" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T09:47:46.767366+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shielded-ravine-63121.herokuapp.com request_id=f04e9670-5a44-4710-a2e3-18e4e43e49e3 fwd="42.104.72.2" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T09:47:48.117184+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shielded-ravine-63121.herokuapp.com request_id=b1b0d3f0-1247-4fcd-a942-a92a6c1484b0 fwd="42.104.72.2" dyno= connect= service= status=503 bytes= protocol=https

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

您的启动脚本是否将节点引用为nodejs?

也许可以尝试

node ./bin/www