'无法找到该进程类型'heroku节点部署

时间:2017-05-16 21:20:52

标签: node.js heroku deployment

当我尝试$ heroku ps:scale web=1时,我收到'找不到该流程类型'。我看了一些其他解决方案,建议确保我的Procfile正确拼写并正确推送,这是。

这是我得到的确切错误:

    heroku ps:scale web=1
Scaling dynos... !
 ▸    Couldn't find that process type.
Error: ENOENT: no such file or directory, open '/Users/XXXXXX/.cache/heroku/error.log'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1316:33)
    at Object.fs.appendFileSync (fs.js:1362:6)
    at log (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:87:6)
    at handleErr (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:102:9)
    at process._tickCallback (internal/process/next_tick.js:109:7)

3 个答案:

答案 0 :(得分:9)

我发现问题是什么,在我的项目中,我没有推动到主分支,我正在执行错误的git代码。因此,如果您正在使用不同的分支,那么推送到Heroku的正确方法如下:

git push heroku <branch_name>:master

答案 1 :(得分:1)

虽然以下答案适用于Rails,但它当然适用于任何框架。

应用程序部署日志应列出这些默认类型:

Default types for buildpack -> console, rake, web, worker

(运行git push时显示此日志,您也可以在Heroku信息中心的活动供稿中找到它们)

如果此行(或类似内容)不存在,则可能是由于您的应用的构建包。您可以列出:

$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. heroku/ruby
2. https://github.com/some/buildpack.git

在此示例中,heroku/ruby首先出现,这可能听起来合法。但似乎最后一个buildpack取消了heroku/ruby创建的类型。要解决此问题,请确保此buildpack最后一次。您可以使用buildpacks:removebuildpacks:add --index

来实现这一目标
$ heroku buildpacks:remove https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks:add --index 1 https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. https://github.com/some/buildpack.git
2. heroku/ruby

使用git push再次部署应用,现在可以启动webworker个进程。

答案 2 :(得分:0)

正如Philippe所提到的,heroku具有许多资源类型,例如控制台,Rake,Web,工作者。

我的Procfile是

web: gunicorn mysite.wsgi --log-file - 

如此

heroku ps:scale web=0为我工作

相关问题