尝试加载时出现Heroku node.js应用程序错误

时间:2019-03-20 04:51:23

标签: node.js heroku

我的应用是带有react和postgresql的全栈node.js。目前,我正在尝试在Heroku上部署该应用程序,但尝试这样做时却遇到这些错误。

2019-03-20T04:16:33.161520+00:00 app[web.1]: npm ERR! errno 1
2019-03-20T04:16:33.163636+00:00 app[web.1]: npm ERR! backend@1.0.0 start: `node server.js`
2019-03-20T04:16:33.163993+00:00 app[web.1]: npm ERR! Exit status 1
2019-03-20T04:16:33.164331+00:00 app[web.1]: npm ERR!
2019-03-20T04:16:33.164619+00:00 app[web.1]: npm ERR! Failed at the backend@1.0.0 start script.
2019-03-20T04:16:33.164875+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-03-20T04:16:33.173748+00:00 app[web.1]: 
2019-03-20T04:16:33.174314+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-03-20T04:16:33.174588+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-03-20T04_16_33_166Z-debug.log
2019-03-20T04:16:33.227172+00:00 heroku[web.1]: Process exited with status 1
2019-03-20T04:16:33.248677+00:00 heroku[web.1]: State changed from crashed to starting
2019-03-20T04:16:45.744952+00:00 heroku[web.1]: Starting process with command `npm start`
2019-03-20T04:16:47.561753+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-20T04:16:47.544492+00:00 heroku[web.1]: Process exited with status 1
2019-03-20T04:16:47.396131+00:00 app[web.1]: 
2019-03-20T04:16:47.396162+00:00 app[web.1]: > backend@1.0.0 start /app
2019-03-20T04:16:47.396164+00:00 app[web.1]: > node server.js
2019-03-20T04:16:47.396166+00:00 app[web.1]: 
2019-03-20T04:16:47.477855+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-03-20T04:16:47.477861+00:00 app[web.1]: throw err;
2019-03-20T04:16:47.477863+00:00 app[web.1]: ^
2019-03-20T04:16:47.477864+00:00 app[web.1]: 
2019-03-20T04:16:47.477866+00:00 app[web.1]: Error: Cannot find module '/app/server.js'
2019-03-20T04:16:47.477868+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-03-20T04:16:47.477869+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-03-20T04:16:47.477871+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-03-20T04:16:47.477873+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-03-20T04:16:47.477874+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-03-20T04:16:47.484427+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-03-20T04:16:47.484841+00:00 app[web.1]: npm ERR! errno 1
2019-03-20T04:16:47.485999+00:00 app[web.1]: npm ERR! backend@1.0.0 start: `node server.js`
2019-03-20T04:16:47.486120+00:00 app[web.1]: npm ERR! Exit status 1
2019-03-20T04:16:47.486343+00:00 app[web.1]: npm ERR!
2019-03-20T04:16:47.486482+00:00 app[web.1]: npm ERR! Failed at the backend@1.0.0 start script.
2019-03-20T04:16:47.486606+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-03-20T04:16:47.491538+00:00 app[web.1]: 
2019-03-20T04:16:47.491682+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-03-20T04:16:47.491768+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-03-20T04_16_47_487Z-debug.log
2019-03-20T04:33:06.000000+00:00 app[api]: Build started by user itzikshaoulian@gmail.com
2019-03-20T04:33:44.521737+00:00 heroku[web.1]: State changed from crashed to starting
2019-03-20T04:33:44.291357+00:00 app[api]: Release v6 created by user itzikshaoulian@gmail.com
2019-03-20T04:33:44.291357+00:00 app[api]: Deploy 9a142871 by user itzikshaoulian@gmail.com
2019-03-20T04:33:45.000000+00:00 app[api]: Build succeeded
2019-03-20T04:33:56.512740+00:00 heroku[web.1]: Starting process with command `npm start`
2019-03-20T04:33:58.256887+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-20T04:33:58.261748+00:00 heroku[web.1]: State changed from crashed to starting
2019-03-20T04:33:58.091779+00:00 app[web.1]: 
2019-03-20T04:33:58.091805+00:00 app[web.1]: > backend@1.0.0 start /app
2019-03-20T04:33:58.091807+00:00 app[web.1]: > node server.js
2019-03-20T04:33:58.091809+00:00 app[web.1]: 
2019-03-20T04:33:58.175375+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-03-20T04:33:58.175378+00:00 app[web.1]: throw err;
2019-03-20T04:33:58.175379+00:00 app[web.1]: ^
2019-03-20T04:33:58.175381+00:00 app[web.1]: 
2019-03-20T04:33:58.175382+00:00 app[web.1]: Error: Cannot find module '/app/server.js'
2019-03-20T04:33:58.175383+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-03-20T04:33:58.175385+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-03-20T04:33:58.175386+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-03-20T04:33:58.175387+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-03-20T04:33:58.175390+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-03-20T04:33:58.180307+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-03-20T04:33:58.180817+00:00 app[web.1]: npm ERR! errno 1
2019-03-20T04:33:58.182092+00:00 app[web.1]: npm ERR! backend@1.0.0 start: `node server.js`
2019-03-20T04:33:58.182248+00:00 app[web.1]: npm ERR! Exit status 1
2019-03-20T04:33:58.182514+00:00 app[web.1]: npm ERR!
2019-03-20T04:33:58.182742+00:00 app[web.1]: npm ERR! Failed at the backend@1.0.0 start script.
2019-03-20T04:33:58.182953+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-03-20T04:33:58.190345+00:00 app[web.1]: 
2019-03-20T04:33:58.190488+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-03-20T04:33:58.190578+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-03-20T04_33_58_184Z-debug.log
2019-03-20T04:33:58.240959+00:00 heroku[web.1]: Process exited with status 1
2019-03-20T04:34:11.941231+00:00 heroku[web.1]: Starting process with command `npm start`
2019-03-20T04:34:14.259202+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-20T04:34:14.240638+00:00 heroku[web.1]: Process exited with status 1
2019-03-20T04:34:14.067868+00:00 app[web.1]: 
2019-03-20T04:34:14.067887+00:00 app[web.1]: > backend@1.0.0 start /app
2019-03-20T04:34:14.067889+00:00 app[web.1]: > node server.js
2019-03-20T04:34:14.067890+00:00 app[web.1]: 
2019-03-20T04:34:14.159638+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-03-20T04:34:14.159644+00:00 app[web.1]: throw err;
2019-03-20T04:34:14.159645+00:00 app[web.1]: ^
2019-03-20T04:34:14.159647+00:00 app[web.1]: 
2019-03-20T04:34:14.159649+00:00 app[web.1]: Error: Cannot find module '/app/server.js'
2019-03-20T04:34:14.159651+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-03-20T04:34:14.159653+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-03-20T04:34:14.159655+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-03-20T04:34:14.159657+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-03-20T04:34:14.159659+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-03-20T04:34:14.164638+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-03-20T04:34:14.165030+00:00 app[web.1]: npm ERR! errno 1
2019-03-20T04:34:14.166426+00:00 app[web.1]: npm ERR! backend@1.0.0 start: `node server.js`
2019-03-20T04:34:14.166611+00:00 app[web.1]: npm ERR! Exit status 1
2019-03-20T04:34:14.166866+00:00 app[web.1]: npm ERR!
2019-03-20T04:34:14.167044+00:00 app[web.1]: npm ERR! Failed at the backend@1.0.0 start script.
2019-03-20T04:34:14.167215+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-03-20T04:34:14.194777+00:00 app[web.1]: 
2019-03-20T04:34:14.194987+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-03-20T04:34:14.195110+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-03-20T04_34_14_168Z-debug.log
2019-03-20T04:34:42.733744+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hamiltonbeach.herokuapp.com request_id=36dbd877-c0c9-419a-b607-e9e76845fb17 fwd="148.75.64.21" dyno= connect= service= status=503 bytes= protocol=https
2019-03-20T04:34:43.349100+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hamiltonbeach.herokuapp.com request_id=36c20d0b-724f-4e3e-b2fd-44729077d91e fwd="148.75.64.21" dyno= connect= service= status=503 bytes= protocol=https

这是我的package.json文件:

{
  "name": "backend",
  "version": "1.0.0",
  "main": "product.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "",
  "license": "MIT",
  "description": "",
  "dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.18.3",
    "config": "^3.0.1",
    "cors": "^2.8.5",
    "ejs": "^2.6.1",
    "express": "^4.16.4",
    "hogan.js": "^3.0.2",
    "jsonwebtoken": "^8.5.0",
    "knex": "^0.16.3",
    "nodemailer": "^5.1.1",
    "nodemailer-sendgrid-transport": "^0.2.0",
    "paypal-rest-sdk": "^1.8.1",
    "pg": "^7.8.1",
    "router": "^1.3.3"
  }
}

这就是应用程序结构:

enter image description here

我在任何地方都找不到应用程序结构应该如何。我尝试查找错误提示,但找不到答案。它说该应用已部署,但仍然无法正常工作。

0 个答案:

没有答案