如何指定要首先执行heroku的文件



我使用node,js并从heroku获得这个LOG,我认为这是一个heroku没有找到的丢失文件。但在Json文件中,我将主文件放在了我的index.js中,但仍然无法工作,也没有看到任何关于它的帖子

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...

软件包.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"
},

在您的图片中,您没有定义开始脚本。

最新更新