Heroku CLI Error: create is not a heroku command - macos

I have created heroku applications from the terminal before, but for some reason, this is not working for me:
$ heroku create my-app
I get the following result
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
▸ create is not a heroku command.
▸ Perhaps you meant update
▸ Run heroku help for a list of available commands.
I updated my brew to have the latest version of heroku. When I run heroku -v I get:
heroku-cli/6.15.11 (darwin-x64) node-v9.3.0
I'm also pretty sure it is installed correctly. When I run which heroku I get:
/usr/local/bin/heroku
One weird clue seems to be that heroku help gives me the following:
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Refreshing plugins... !
▸ semver has no commands. Is this a CLI plugin?
Refreshing plugins... done
Usage: heroku COMMAND
Help topics, type heroku help TOPIC for more details:
auth
plugins add/remove CLI plugins
Which seems like it clearly does not include create as one of the commands, so do I need to add create somehow? I know that create is shorthand for apps:create so I tried both and got the same result.
I'm not sure if it's relevant, but I recently updated to Mac OS High Sierra.

I hit the same problem. The only solution I found was to uninstall from homebrew, and then manually install the heroku-cli package from here https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli.pkg
I only experienced this after upgrading to High Sierra.

Please, make sure your path variable are setup correctly
Please, make sure that you are logged in to your account.
You can login using following command from command line:
$ heroku login
Email: <your email>
Password: <your password>
navigate to the root folder in your system where you want to host application locally and try with your command.

This ended up being a bigger issue than originally expected. Today (after trying the suggestion in the comments), I realized I was also having issues with node (I was unable to npm init anywhere). I ended up completely reinstalling macOS.
When that didn't work, I erased and reinstalled macOS completely. After reinstalling node and heroku through brew, it did work.
I know erasing and reinstalling macOS is a pretty drastic option, but it didn't seem like anything else was working. I'm hoping there's a better answer out there, but I just wanted to include this in case someone else stumbled upon this question.

Related

My Heroku-cli not recognizing commands. (Mac OS X)

When I run $"heroku help" in my Mac OS X Terminal, I get the following error from the Heroku Cli.
$ heroku help
▸ help is not a heroku command.
▸ Perhaps you meant help
▸ Run heroku help for a list of available commands.
And it applies to every heroku command except "heroku login".
$ heroku restart
▸ restart is not a heroku command.
▸ Perhaps you meant restart
▸ Run heroku help for a list of available commands.
etc...
Is anyone else experiencing the same problem? Or how do I fix it? Thanks.
I'm having the same issue (OSX) and was able to fix it. Here's what I did.
https://devcenter.heroku.com/articles/heroku-cli#troubleshooting
That link has some trouble shooting help. It referenced a log file so I went there.
cat ~/Library/Caches/heroku/error.log
Nothing obviously wrong for me, just references to "...is not a command", but the stack traces called out the following path.
/Users/[username]/.local/share/heroku/
I deleted that folder and did another reinstall of heroku.
Everything started working for me.
One thing I noticed was that although I had ungraded heroku and it said it was installing a new version, running the following command still declared the previous version I had installed.
heroku --version
so it sounds like it's a caching issue.

Heroku CLI hangs on Windows 10

I use Heroku CLI on Windows 10. The first day after installing it works just fine, but on the next day (or so) it just hangs after launch:
C:\Users\{User}>heroku
and that's all. No output to console, no logs (no error.log). It lasts forever (not 120 sec like here: Heroku CLI Unresponsive)
I reinstalled CLI on 10.10.2017. Today is 14.10, my folder contains the following files:
folder view before cleaning
The autoupdate.log contains:
[2017-10-10T13:36:14+03:00] starting `C:\Program Files (x86)\Heroku\bin\\heroku.cmd update --autoupdate` from
heroku-cli: Updating CLI... already on latest version: 6.14.34-1fcf80e
heroku-cli: Updating plugins... done
[2017-10-11T22:36:40+03:00] starting `C:\Program Files (x86)\Heroku\bin\\heroku.cmd update --autoupdate` from logs
heroku-cli: Updating CLI... already on latest version: 6.14.34-1fcf80e
heroku-cli: Updating plugins... Waiting for all commands to finish
heroku-cli: Updating plugins... done
[2017-10-14T01:13:34+03:00] starting `C:\Program Files (x86)\Heroku\bin\\heroku.cmd update --autoupdate` from logs
heroku-cli: Updating CLI... already on latest version: 6.14.34-1fcf80e
heroku-cli: Updating plugins... Waiting for all commands to finish
What have I tried:
uninstall and install again - this one works, but I don`t want to do
this every day
running as administrator
waiting all night long
using different commands (heroku --version, heroku update etc)
delete folder ..\AppData\Local\heroku
After deleting the folder and running command 'heroku update' the following files & folders were created, but console still hangs:
folder view after cleaning
The autoupdate.log consists now of 1 line:
[2017-10-14T19:39:02+03:00] starting `C:\Program Files (x86)\Heroku\bin\\heroku.cmd update --autoupdate` from update
I waited for an hour since and now writing this question here. Has anyone faced such an issue? What can be done?
Update
Finally I made it work after a few days by reinstalling CLI several times and deleting the autoupdate files, but cannot say precisely which of my actions had true effect. If you face the same issue you can start with the Malik`s answer.
I encountered the same problem when I run $ heroku login on GitBash for Windows.
I tried the accepted answer above but to no avail. What solved it was just to use Windows Command Prompt instead of GitBash and all problems were solved.
I'm just adding this answer here in case someone has done the same thing like I did.
Using GitCMD instead of GitBash solved the problem for me.
I had the same issue and i followed these steps to fix it.
Go to heroku AppData directory. (windows run %LOCALAPPDATA%\heroku)
You should see 2 files named as autoupdate and a directory named as update.lock.
Delete these 2 files and the directory.
Open a new cmd window.
Try running the heroku cmd again. Now it should work for you.
I use following version
heroku-cli/6.14.36 , (windows-x64) , node-v8.9.0.
Relevant github issue thread
I got the same symptom because I was behind a proxy but did not set the proxy env vars.
export HTTP_PROXY=http://proxy.server.com:portnumber
export HTTPS_PROXY=https://proxy.server.com:portnumber
heroku login
Usin CMD git for heroku login. I had to do the other steps using the bash and all was perfect.

Windows bash 'Cannot create property 'exitCode' on string 'autoupdate:' Installing Heroku CLI/Toolbelt

I am attempting to install the Heroku CLI/Toolbelt on an bash shell version 4.3.48(1) (x86_64-pc-linux-gnu) running on Windows 10. I'm entering wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh in the command line, and after the packages download I'm getting the below:
Preparing to unpack .../heroku_6.14.24-1_amd64.deb ...
Unpacking heroku (6.14.24-1) ...
Setting up heroku (6.14.24-1) ...
+ which heroku
+ LOCATION=/usr/bin/heroku
+ echo heroku cli installed to /usr/bin/heroku
heroku cli installed to /usr/bin/heroku
+ heroku version
▸ Cannot create property 'exitCode' on string 'autoupdate:'
And then it just takes me back to the command line. If I try heroku --v or any other heroku CLI command I get this same error
▸ Cannot create property 'exitCode' on string 'autoupdate:'
I can't find any record of this error code anywhere online. Any thoughts? I really do not know where to start here, usually a good search at least sets me on the path but I have crickets here. Let me know if any further details are required. FWIW the toolbelt was working as of a few days ago, I just had to uninstall and reinstall my bash shell due to an unfortunate incident with Linuxbrew so am rebuilding everything from scratch.
this is fixed but the CLI might have trouble updating. Delete ~/.local/share/heroku and run heroku update and it should be fixed.

MODULE_NOT_FOUND in heroku pg:backups

I've got problem with heroku pg:backups capture --app myapp command.
Heroku CLI submits usage information back to Heroku. If you would like to disable this, set `skip_analytics: true` in /home/ubuntu/.heroku/config.json
heroku-cli: Updating to 4.99.0-e5f5ef4... done
heroku-cli: Updating CLI...heroku-cli: Updating to 5.11.8-f58f4fa... done
Starting backup of postgresql-spherical-5948... done
Use Ctrl-C at any time to stop monitoring progress; the backup will continue running.
Use heroku pg:backups:info to check progress.
Stop a running backup with heroku pg:backups:cancel.
Backing up DATABASE to b598... pending
Backing up DATABASE to b598... !
▸ MODULE_NOT_FOUND: Cannot find module 'bytes'
Does anybody have similar problem? This command is launched with deploy on CircleCI.
I started running into the same problem yesterday and was finally able to come up with a solution that is working for me.
For starters, it looks like bytes is a dependency of heroku-pg, which is the part of Heroku CLI that is being used for the backups command. It seems like the dependency is not being included or installed with the version of heroku-cli that is being used to run the backup command.
I tried CircleCI’s “Rebuild with SSH” to troubleshoot the issue, and encountered similar error messages when attempting the backup command there. While trying to reinstall heroku-cli using npm, I found that the npm and node versions were way behind what heroku-cli wanted, so maybe that is part of the problem? Anyway, reinstalling with npm only produced an even more broken Heroku CLI.
Finally I checked the build environment and it was set to Ubuntu 12.04 (Precise) which probably explains the way out of date npm/node packages. I changed it to Ubuntu 14.04 (Trusty) and pushed a new commit to CircleCI (A rebuild alone is not sufficient to change OS versions) and was able to successfully run the backup command that had been failing!
Solution: Set CircleCI build environment to Ubuntu 14.04

how to run phantomjs on heroku?

I am trying to run phantomjs on the heroku cedar stack.
I am using a phantomjs buildpack for heroku https://github.com/stomita/heroku-buildpack-phantomjs.
However I followed the instructions but still cannot make it work.
When I run the command heroku run bash and type phantomjs --version it says phantomjs: command not found
I read things about LD_LIBRARY_PATH that needs to be set to "/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib", this is what i did but without success.
Is there something that i am missing ?
Where does the buildpack install the phantomjs binary exactly ? Is there a way to know the path where the binary is ?
I am using ruby 1.9.2
Thanks a lot for your help.
EDIT: To be more precise, i want to combine ruby and phantomjs, so i am using this custom buildpack: https://github.com/ddollar/heroku-buildpack-multi, but when i push to heroku i get "Heroku push rejected, failed to compile Multipack app"
Download the 64-bit linux binary file from phantomjs.org here http://phantomjs.org/download.html
Create a bin/ directory in your app if you do not already have one and place the binary file there. You should then be able to test if you can run it with "heroku run 'phantomjs'" or "heroku run 'bin/phantomjs'"
For phantomjs with javascript
I dont know if the previous examples are actually necessary becasue although i am working with javascript it should not be different. For me all i had to do was place the phantomjs buildpack as the first on the list of installed buildpacks on your master.
check available buildpacks
open terminal from the app folder and type:
heroku buildpacks
This wll show the available buildpacks.
eg.
1.heroku/node.js
2.https://github.com/stomita/heroku-buildpack-phantomjs.git
As you can see the buildpack is second on this list. We need tomake it the first in the list.So, what i did was i removed the phantomjs builpack and then add it again but this time made sure its first on the list of all available buildpacks.
So, to remove a buildpack, type:
heroku buildpacks:remove https://github.com/stomita/heroku-buildpack-phantomjs.git
this removes the buildpack.You can check it by typing:
heroku buildpacks
Now, it should only show,
1.heroku/node.js
Great, now we add the phantomjs buildackmaking sure its first . So on terminal type:
heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git
You can check if its first by typing:
heroku buildpacks
Now, it should be ,
1.https://github.com/stomita/heroku-buildpack-phantomjs.git
2.heroku/node.js
Thats It!!
now, on terminal , type:
heroku run bash
once you're in bash, type
phantomjs --version
The current verion of phantomjs should be shown on the terminal.
2.1.1

Resources