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

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.

Related

What could be the reason why "heroku open" command is not working?

I have successfully deployed a django app on heroku using this guide. The heroku cli is installed as a snap application on my system - I'm running Fedora 32 on a Dell xps 15 - and everything seems to be working fine except when I try to run the app locally.
When I attempt to run the app locally, I get the following error:
$ heroku open
▸ Error opening web browser.
▸ Error: Exited with code 4
▸
▸ Manually visit https://[myapp].herokuapp.com/ in your browser.
I tried variations of the command to no avail:
$ heroku open -a [myapp]
$ heroku open -r https://git.heroku.com/[myapp].git
When, instead, I run it with heroku local it runs without any problems.
I look at the logs but couldn't find any clues. Neither was I able to find any useful information.
What am I missing?
Try setting the browser in your ~/.bashrc using export BROWSER=
If someone uses Windows Subsystem for Linux, set the BROWSER environment variable in the corresponding shell configuration file (e.g., ~/.zshrc) to wslview.
export BROWSER=wslview

Heroku CLI Error: create is not a heroku command

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.

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

Heroku cli: Heroku create command hangs

Heroku Create command hangs while printing installing core dependencies ...
There are no errors, the process is continuously running. This happens as part of my Heroku toolbelt installation. In the website it is mentioned to use HTTP_PROXY before running heroku command, in case we are behind a firewall. I am not sure about that, is that the reason? Please help. I am using Mac El Capitan.

Resources