如何指定一个文件让heroku先执行

How to specify a file to heroku execute first

我正在使用 node,js 并从 heroku 获取此日志,我认为这是 heroku 未找到的丢失文件。但在 Json 文件中,我将主文件放入我的 index.js 但仍然无法正常工作,也没有看到任何 post 关于它

Build succeeded!
 !     This app may not specify any way to start a node process
       https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...

PACKAGE.JSON_IMAGE

你显示的日志没问题
Procfile 在没有定义 proc 时是必需的。 nodejs 构建包的“默认”是 npm start.
在您的 package.json 中,您在 scripts 下定义了 start 的作用。

在 Python 个项目中,您没有类似于 npm start 的项目。所以你必须创建一个 Procfile 与例如内容 worker: python myproject.py


编辑,添加了package.json

这是一个兼容Heroku的项目。它在 heroku 分支上而不是 master/main: https://github.com/d-zone-org/d-zone/tree/heroku

这是 package.json

中的 scripts 部分
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "browserify web/main.js -t brfs -g uglifyify -o web/static/bundle.js",
    "watch": "watchify web/main.js -t brfs -d -o web/static/bundle.js -v",
    "start": "node index.js"
  },

在你的图片中你没有定义启动脚本。