'Couldn't find that process type' heroku node deployment

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-08 17:07:09

问题


I'm getting 'Couldn't find that process type' when I try to do $ heroku ps:scale web=1. I looked at some other solutions that suggested to make sure my Procfile is spelled correctly and pushed correctly, which is.

This is the exact error I get:

    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)

回答1:


I found out what the problem was, in my project, I wasn't pushing to the master branch, and I was performing the wrong git code. So the correct way to push to Heroku if you are working on a different branch is the following:

git push heroku <branch_name>:master



回答2:


Although the following answer is for Rails, it can certainly apply to any framework.

The app deployment logs are supposed to list these default types:

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

(this log is displayed when you run git push, you can also find them in the Activity feed of your Heroku dashboard)

If this line (or something similar) is not present, this might be due to the buildpacks of your app. You can list them with:

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

In this example, heroku/ruby comes first, which might sounds legit. But it seems that the last buildpack cancels the types created by heroku/ruby. To fix this, make sure this buildpack comes last. You can achieve this with buildpacks:remove and buildpacks: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

Deploy the app again with git push, and it is now possible to start web and worker processes.




回答3:


As Philippe mentioned heroku has many resource types, e.g. console, rake, web, worker.

My Procfile was

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

so

heroku ps:scale web=0 worked for me



来源:https://stackoverflow.com/questions/44011770/couldnt-find-that-process-type-heroku-node-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!