簡體   English   中英

如何找出heroku有什么問題?

[英]How to find out what's wrong with heroku?

我創建了一個非常簡單的 nodejs 應用程序,鏈接在這里https://bitbucket.org/danclaudiu95/mongo-nodejs-0.git

我只有一個 index.js 文件

router.get('/', (req, res) => {
    res.send('Hello World')
})

並提交並推送更改到heroku,該應用程序在此處https://git.heroku.com/nodejs-mongo-cc.git ,它告訴我“不允許使用方法”,此處為https://nodejs-mongo-cc。 herokuapp.com/tels應用程序錯誤 我在運行 heroku logs 時收到此日志 --tail 我有此日志

2019-12-08T18:55:25.296312+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
2019-12-08T18:55:25.296314+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2019-12-08T18:55:25.296316+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2019-12-08T18:55:25.296318+00:00 app[web.1]: }
2019-12-08T18:55:25.304642+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-12-08T18:55:25.305127+00:00 app[web.1]: npm ERR! errno 1
2019-12-08T18:55:25.306936+00:00 app[web.1]: npm ERR! mongo-nodejs-0@1.0.0 start: `node server.js`
2019-12-08T18:55:25.307220+00:00 app[web.1]: npm ERR! Exit status 1
2019-12-08T18:55:25.307516+00:00 app[web.1]: npm ERR!
2019-12-08T18:55:25.307771+00:00 app[web.1]: npm ERR! Failed at the mongo-nodejs-0@1.0.0 start script.
2019-12-08T18:55:25.308011+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-12-08T18:55:25.316870+00:00 app[web.1]: 
2019-12-08T18:55:25.317055+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-12-08T18:55:25.317209+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-12-08T18_55_25_308Z-debug.log
2019-12-08T18:55:25.382554+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-08T18:55:25.387301+00:00 heroku[web.1]: State changed from crashed to starting
2019-12-08T18:55:25.361045+00:00 heroku[web.1]: Process exited with status 1
2019-12-08T18:55:26.985866+00:00 heroku[web.1]: Starting process with command `npm start`
2019-12-08T18:55:28.903449+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-08T18:55:28.773773+00:00 app[web.1]: 
2019-12-08T18:55:28.773792+00:00 app[web.1]: > mongo-nodejs-0@1.0.0 start /app
2019-12-08T18:55:28.773795+00:00 app[web.1]: > node server.js
2019-12-08T18:55:28.773797+00:00 app[web.1]: 
2019-12-08T18:55:28.821433+00:00 app[web.1]: internal/modules/cjs/loader.js:800
2019-12-08T18:55:28.821437+00:00 app[web.1]: throw err;
2019-12-08T18:55:28.821443+00:00 app[web.1]: ^
2019-12-08T18:55:28.821445+00:00 app[web.1]: 
2019-12-08T18:55:28.821447+00:00 app[web.1]: Error: Cannot find module 'express'
2019-12-08T18:55:28.821449+00:00 app[web.1]: Require stack:
2019-12-08T18:55:28.821451+00:00 app[web.1]: - /app/server.js
2019-12-08T18:55:28.821452+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
2019-12-08T18:55:28.821454+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:690:27)
2019-12-08T18:55:28.821456+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:852:19)
2019-12-08T18:55:28.821457+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2019-12-08T18:55:28.821459+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:1:17)
2019-12-08T18:55:28.821460+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:959:30)
2019-12-08T18:55:28.821462+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
2019-12-08T18:55:28.821463+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:815:32)
2019-12-08T18:55:28.821465+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:727:14)
2019-12-08T18:55:28.821467+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
2019-12-08T18:55:28.821468+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2019-12-08T18:55:28.821470+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2019-12-08T18:55:28.821471+00:00 app[web.1]: }
2019-12-08T18:55:28.827415+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-12-08T18:55:28.827775+00:00 app[web.1]: npm ERR! errno 1
2019-12-08T18:55:28.828849+00:00 app[web.1]: npm ERR! mongo-nodejs-0@1.0.0 start: `node server.js`
2019-12-08T18:55:28.829049+00:00 app[web.1]: npm ERR! Exit status 1
2019-12-08T18:55:28.829213+00:00 app[web.1]: npm ERR!
2019-12-08T18:55:28.829353+00:00 app[web.1]: npm ERR! Failed at the mongo-nodejs-0@1.0.0 start script.
2019-12-08T18:55:28.829473+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-12-08T18:55:28.836399+00:00 app[web.1]: 
2019-12-08T18:55:28.836520+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-12-08T18:55:28.836621+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-12-08T18_55_28_830Z-debug.log
2019-12-08T18:55:28.884330+00:00 heroku[web.1]: Process exited with status 1
2019-12-08T18:56:13.485700+00:00 app[api]: Release v4 created by user dan_tomuta@yahoo.com
2019-12-08T18:56:13.485700+00:00 app[api]: Set DATABASE_URL config vars by user dan_tomuta@yahoo.com
2019-12-08T18:56:14.534382+00:00 heroku[web.1]: State changed from crashed to starting
2019-12-08T18:56:16.302004+00:00 heroku[web.1]: Starting process with command `npm start`
2019-12-08T18:56:20.368258+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-08T18:56:20.348173+00:00 heroku[web.1]: Process exited with status 1
2019-12-08T18:56:20.213878+00:00 app[web.1]: 
2019-12-08T18:56:20.213966+00:00 app[web.1]: > mongo-nodejs-0@1.0.0 start /app
2019-12-08T18:56:20.213969+00:00 app[web.1]: > node server.js
2019-12-08T18:56:20.213972+00:00 app[web.1]: 
2019-12-08T18:56:20.279308+00:00 app[web.1]: internal/modules/cjs/loader.js:800
2019-12-08T18:56:20.279312+00:00 app[web.1]: throw err;
2019-12-08T18:56:20.279314+00:00 app[web.1]: ^
2019-12-08T18:56:20.279316+00:00 app[web.1]: 
2019-12-08T18:56:20.279318+00:00 app[web.1]: Error: Cannot find module 'express'
2019-12-08T18:56:20.279320+00:00 app[web.1]: Require stack:
2019-12-08T18:56:20.279326+00:00 app[web.1]: - /app/server.js
2019-12-08T18:56:20.279344+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
2019-12-08T18:56:20.279346+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:690:27)
2019-12-08T18:56:20.279349+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:852:19)
2019-12-08T18:56:20.279352+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2019-12-08T18:56:20.279354+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:1:17)
2019-12-08T18:56:20.279356+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:959:30)
2019-12-08T18:56:20.279359+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
2019-12-08T18:56:20.279361+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:815:32)
2019-12-08T18:56:20.279363+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:727:14)
2019-12-08T18:56:20.279365+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
2019-12-08T18:56:20.279367+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2019-12-08T18:56:20.279369+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2019-12-08T18:56:20.279371+00:00 app[web.1]: }
2019-12-08T18:56:20.284895+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-12-08T18:56:20.285175+00:00 app[web.1]: npm ERR! errno 1
2019-12-08T18:56:20.286349+00:00 app[web.1]: npm ERR! mongo-nodejs-0@1.0.0 start: `node server.js`
2019-12-08T18:56:20.286533+00:00 app[web.1]: npm ERR! Exit status 1
2019-12-08T18:56:20.286713+00:00 app[web.1]: npm ERR!
2019-12-08T18:56:20.286852+00:00 app[web.1]: npm ERR! Failed at the mongo-nodejs-0@1.0.0 start script.
2019-12-08T18:56:20.287001+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-12-08T18:56:20.293863+00:00 app[web.1]: 
2019-12-08T18:56:20.294005+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-12-08T18:56:20.294099+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-12-08T18_56_20_287Z-debug.log
2019-12-08T18:59:25.447421+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=nodejs-mongo-cc.herokuapp.com request_id=78ed9049-8e85-459d-9579-6a64cdf4a09a fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https
2019-12-08T18:59:26.012326+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nodejs-mongo-cc.herokuapp.com request_id=9f49a46a-ecef-43c3-9f14-e9143c147a5d fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https
2019-12-08T18:59:26.700786+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=nodejs-mongo-cc.herokuapp.com request_id=b623338f-0d3d-4ec9-8fa5-6947eaa8ca89 fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https
2019-12-08T18:59:27.151441+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nodejs-mongo-cc.herokuapp.com request_id=25967892-0116-4f11-b1e4-fbd051814247 fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https
2019-12-08T18:59:28.370508+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=nodejs-mongo-cc.herokuapp.com request_id=5627ecd7-98ef-45a1-8475-3b4dfdd91893 fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https
2019-12-08T18:59:28.869557+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nodejs-mongo-cc.herokuapp.com request_id=0afb7f92-58ad-4496-84bc-40fc47ebf3b9 fwd="178.138.96.80" dyno= connect= service= status=503 bytes= protocol=https

任何人都可以幫助我嗎?

確保遵循 Heroku 網站中的 node.js 指南。 您可以在此處找到 - 使用 Node.js 開始使用 Heroku 確保在項目中添加一個名為 Procfile 的文件並輸入 - web: node index.js 並且不要忘記在你的 js 文件中有一個監聽器 - app.listen(process.env.PORT); . 將文件從 git 推送到 Heroku 后,轉到 Heroku 網站,登錄,您將看到已發布的應用程序(可能需要一段時間來構建)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM