Heroku NodeJS部署错误-启动脚本失败

时间:2019-07-06 12:02:49

标签: javascript node.js heroku deployment

尝试将节点应用程序部署到Heroku时出现奇怪的错误-在crm-api@1.0.0启动脚本处失败。

这是我的仓库的链接-https://github.com/fishj123/CRM-API

这是我的错误日志:

2019-07-06T11:21:55.154778+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-07-06T11:21:55.154780+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:15:25)
2019-07-06T11:21:55.154782+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-06T11:21:55.154783+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-06T11:21:55.154785+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-06T11:21:55.163928+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-07-06T11:21:55.164396+00:00 app[web.1]: npm ERR! errno 1
2019-07-06T11:21:55.165476+00:00 app[web.1]: npm ERR! crm-api@1.0.0 start: `node app.js`
2019-07-06T11:21:55.165587+00:00 app[web.1]: npm ERR! Exit status 1
2019-07-06T11:21:55.165787+00:00 app[web.1]: npm ERR!
2019-07-06T11:21:55.165902+00:00 app[web.1]: npm ERR! Failed at the crm-api@1.0.0 start script.
2019-07-06T11:21:55.165998+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-07-06T11:21:55.175793+00:00 app[web.1]:
2019-07-06T11:21:55.175951+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-07-06T11:21:55.176025+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-07-06T11_21_55_167Z-debug.log
2019-07-06T11:21:55.236179+00:00 heroku[web.1]: Process exited with status 1
2019-07-06T11:45:59.000000+00:00 app[api]: Build started by user jackfisher94@live.co.uk
2019-07-06T11:46:18.166281+00:00 heroku[web.1]: State changed from crashed to starting
2019-07-06T11:46:17.778489+00:00 app[api]: Release v9 created by user jackfisher94@live.co.uk
2019-07-06T11:46:17.778489+00:00 app[api]: Deploy 24a98021 by user jackfisher94@live.co.uk
2019-07-06T11:46:18.000000+00:00 app[api]: Build succeeded
2019-07-06T11:46:20.394900+00:00 heroku[web.1]: Starting process with command `npm start`
2019-07-06T11:46:22.581404+00:00 app[web.1]:
2019-07-06T11:46:22.581421+00:00 app[web.1]: > crm-api@1.0.0 start /app
2019-07-06T11:46:22.581423+00:00 app[web.1]: > node app.js
2019-07-06T11:46:22.581425+00:00 app[web.1]:
2019-07-06T11:46:23.332661+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-06T11:46:23.317305+00:00 heroku[web.1]: Process exited with status 1
2019-07-06T11:46:23.251977+00:00 app[web.1]: internal/modules/cjs/loader.js:638
2019-07-06T11:46:23.252009+00:00 app[web.1]: throw err;
2019-07-06T11:46:23.252011+00:00 app[web.1]: ^
2019-07-06T11:46:23.252012+00:00 app[web.1]:
2019-07-06T11:46:23.252014+00:00 app[web.1]: Error: Cannot find module '../models/Client'
2019-07-06T11:46:23.252016+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
2019-07-06T11:46:23.252017+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:562:25)
2019-07-06T11:46:23.252019+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2019-07-06T11:46:23.252020+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-07-06T11:46:23.252022+00:00 app[web.1]: at Object.<anonymous> (/app/routes/clients.js:3:30)
2019-07-06T11:46:23.252023+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-06T11:46:23.252025+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-06T11:46:23.252026+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-06T11:46:23.252028+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-07-06T11:46:23.252029+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-07-06T11:46:23.252031+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2019-07-06T11:46:23.252032+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-07-06T11:46:23.252034+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:15:25)
2019-07-06T11:46:23.252035+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-06T11:46:23.252037+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-06T11:46:23.252038+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-06T11:46:23.270836+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-07-06T11:46:23.271510+00:00 app[web.1]: npm ERR! errno 1
2019-07-06T11:46:23.273284+00:00 app[web.1]: npm ERR! crm-api@1.0.0 start: `node app.js`
2019-07-06T11:46:23.273484+00:00 app[web.1]: npm ERR! Exit status 1
2019-07-06T11:46:23.273865+00:00 app[web.1]: npm ERR!
2019-07-06T11:46:23.274101+00:00 app[web.1]: npm ERR! Failed at the crm-api@1.0.0 start script.
2019-07-06T11:46:23.274283+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-07-06T11:46:23.280471+00:00 app[web.1]:
2019-07-06T11:46:23.280632+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-07-06T11:46:23.280744+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-07-06T11_46_23_276Z-debug.log
2019-07-06T11:46:23.345339+00:00 heroku[web.1]: State changed from crashed to starting
2019-07-06T11:46:25.436499+00:00 heroku[web.1]: Starting process with command `npm start`
2019-07-06T11:46:27.251643+00:00 app[web.1]:
2019-07-06T11:46:27.251668+00:00 app[web.1]: > crm-api@1.0.0 start /app
2019-07-06T11:46:27.251671+00:00 app[web.1]: > node app.js
2019-07-06T11:46:27.251673+00:00 app[web.1]:
2019-07-06T11:46:27.989715+00:00 app[web.1]: internal/modules/cjs/loader.js:638
2019-07-06T11:46:27.989746+00:00 app[web.1]: throw err;
2019-07-06T11:46:27.989748+00:00 app[web.1]: ^
2019-07-06T11:46:27.989750+00:00 app[web.1]:
2019-07-06T11:46:27.989751+00:00 app[web.1]: Error: Cannot find module '../models/Client'
2019-07-06T11:46:27.989753+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
2019-07-06T11:46:27.989755+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:562:25)
2019-07-06T11:46:27.989756+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2019-07-06T11:46:27.989758+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-07-06T11:46:27.989759+00:00 app[web.1]: at Object.<anonymous> (/app/routes/clients.js:3:30)
2019-07-06T11:46:27.989761+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-06T11:46:27.989762+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-06T11:46:27.989764+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-06T11:46:27.989765+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-07-06T11:46:27.989767+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-07-06T11:46:27.989768+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2019-07-06T11:46:27.989769+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-07-06T11:46:27.989771+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:15:25)
2019-07-06T11:46:27.989772+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-06T11:46:27.989774+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-06T11:46:27.989775+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-06T11:46:27.999517+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-07-06T11:46:28.000249+00:00 app[web.1]: npm ERR! errno 1
2019-07-06T11:46:28.002067+00:00 app[web.1]: npm ERR! crm-api@1.0.0 start: `node app.js`
2019-07-06T11:46:28.002366+00:00 app[web.1]: npm ERR! Exit status 1
2019-07-06T11:46:28.002754+00:00 app[web.1]: npm ERR!
2019-07-06T11:46:28.003069+00:00 app[web.1]: npm ERR! Failed at the crm-api@1.0.0 start script.
2019-07-06T11:46:28.003349+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-07-06T11:46:28.010396+00:00 app[web.1]:
2019-07-06T11:46:28.010549+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-07-06T11:46:28.010665+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-07-06T11_46_28_004Z-debug.log
2019-07-06T11:46:28.077026+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-06T11:46:28.055661+00:00 heroku[web.1]: Process exited with status 1
2019-07-06T11:46:29.998976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=enigmatic-everglades-16570.herokuapp.com request_id=7ed55230-9061-44af-b4ff-63c1cd6410b9 fwd="92.233.88.145" dyno= connect= service= status=503 bytes= protocol=https
2019-07-06T11:46:31.114248+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=enigmatic-everglades-16570.herokuapp.com request_id=da65875b-1252-43df-9128-c170d3b3a8a0 fwd="92.233.88.145" dyno= connect= service= status=503 bytes= protocol=https

到目前为止我尝试过的事情:

  1. 更新NPM / NodeJS
  2. 删除节点模块和Package.lock.json,清除缓存,npm安装
  3. 在本地运行启动脚本(节点app.js)
  4. npm运行app.js

该项目在我的本地版本上运行正常,因此我无法确定启动脚本失败的原因。真的很感谢任何建议。

谢谢

0 个答案:

没有答案