【问题标题】:I am getting the error Error: Cannot find module '/app/index.js' on Heroku我收到错误错误:在 Heroku 上找不到模块“/app/index.js”
【发布时间】:2021-07-13 00:30:16
【问题描述】:

我的 Procfile 是: 工人:index.js 我确定所有内容都正确大写,但我不知道该怎么做。

【问题讨论】:

  • 你的项目根目录中有index.js
  • 是的,我有一个。
  • “我确定所有内容都大写正确”——那为什么你的Procfile 包含Worker:,而不是worker:?在任何情况下,您的Procfile 可能应该更像worker: node index.js。请edit您的问题并向我们展示您的整个Procfile 和您的目录结构。

标签: heroku


【解决方案1】:

按照官方文档https://devcenter.heroku.com/articles/procfile,您可能应该使用小写的worker:

worker: index.js

但您的错误来自您的 index.js 位置。

编辑:我在this post找到了一些东西,我认为你需要使用:

worker: node index.js

【讨论】:

    猜你喜欢
    • 2016-12-25
    • 2021-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-07
    • 1970-01-01
    • 2018-11-07
    • 2018-12-30
    相关资源
    最近更新 更多