这是我第一次尝试部署,我选择了Heroku
,请原谅我,我将它部署为一个有趣的项目,用于练习目的。
我已按照此站点说明
更新 1:
使用 修复 Procfile 后web: node ./src/index.js
,需要index.js
修复的错误已修复,但它导致我遇到另一个我真的不知道如何修复的问题。
这是它的日志:
2022-01-06T19:22:51.002284 00:00 app[web.1]: internal/modules/cjs/loader.js:905
2022-01-06T19:22:51.002303 00:00 app[web.1]: throw err;
2022-01-06T19:22:51.002304 00:00 app[web.1]: ^
2022-01-06T19:22:51.002304 00:00 app[web.1]:
2022-01-06T19:22:51.002304 00:00 app[web.1]: Error: Cannot find module '@supabase/supabase-js'
2022-01-06T19:22:51.002304 00:00 app[web.1]: Require stack:
2022-01-06T19:22:51.002305 00:00 app[web.1]: - /app/src/index.js
2022-01-06T19:22:51.002305 00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
2022-01-06T19:22:51.002306 00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:746:27)
2022-01-06T19:22:51.002306 00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:974:19)
2022-01-06T19:22:51.002306 00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:93:18)
2022-01-06T19:22:51.002306 00:00 app[web.1]: at Object.<anonymous> (/app/src/index.js:9:26)
2022-01-06T19:22:51.002307 00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14)
2022-01-06T19:22:51.002307 00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
2022-01-06T19:22:51.002308 00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:950:32)
2022-01-06T19:22:51.002308 00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:790:12)
2022-01-06T19:22:51.002308 00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
2022-01-06T19:22:51.002309 00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2022-01-06T19:22:51.002309 00:00 app[web.1]: requireStack: [ '/app/src/index.js' ]
2022-01-06T19:22:51.002309 00:00 app[web.1]: }
2022-01-06T19:22:51.275795 00:00 heroku[web.1]: State changed from starting to crashed
2022-01-06T19:22:48.000000 00:00 app[api]: Build succeeded
uj5u.com热心网友回复:
Heroku 找不到您的index.js
档案:
错误:找不到模块“/app/index.js”
看起来您index.js
在一个名为src/
. 这应该反映在您的Procfile
:
web: node src/index.js
0 评论