Installing Heroku CLI on a mac - heroku

Following the documentation, I tried installing the Heroku CLI by typing the following into Terminal:
brew tap heroku/brew && brew install heroku
The installation seems to work successfully. However, when I then type heroku --version, or indeed any other Heroku command, I get the error message:
zsh: command not found: heroku
Can anyone please explain what I am doing wrong here? Many thanks in advance.

Related

How do I install Heroku CLI on Termux?

Termux is a Linux terminal emulator for Android. I want to install the Heroku CLI to be able to manage my Heroku apps on the go, I tried typing heroku to prompt the error message and link to the right package, but it gives me:
No command 'heroku' found, did you mean:
Command 'heyu' from package 'heyu'
I tried installing the CLI from the official website, but that didn't work out as well. What should I do?
Use the npm package heroku, its the complete CLI as what you find from the official website. Simply do
npm i -g heroku
Alternatively, you may use yarn. Install yarn by doing
pkg install yarn
and then install the Heroku CLI by
yarn add global heroku-cli#latest

The heroku cli fails

I run
heroku logs
and get
'ENOCOMMANDS': semver has no commands. Is this a CLI plugin?
Is there a problem with the current version of heroku? I have searched for both ENOCOMMANDS and semver with no useful results.
I had the same issue. I fixed it by uninstalling and then installing heroku like this...
$brew uninstall --force heroku
$rm -rf ~/.local/share/heroku ~/.config/heroku ~/Library/Caches/heroku
$brew install heroku

error: cannot install "heroku": snap not found

I am following the instructions from official heroku website to install heroku on my ubuntu 14.04.
First I installed snapd on ubuntu and then tried to install heroku by running:
sudo snap install heroku
But I am getting following error
error: cannot install "heroku": snap not found
I posted this question on askubuntu but it wasn't of much help. Could somebody please help how can I fix this issue ?
To install heroku in all currently supported versions of Ubuntu open the terminal and type:
sudo snap install --classic heroku
This installs the heroku snap package successfully, and it is the recommended way of installing Heroku CLI in Ubuntu at the Heroku Dev Center website. When this was posted sudo snap install --classic heroku installs the latest version of Heroku.

Heroku CLI suddenly broken

Suddenly, from one command to the next, the Heroic CLI stopped working. No matter what I type into the command line, I get the same error. See below.
$heroku help
▸ commands is not a heroku command.
▸ Perhaps you meant domains
▸ Run heroku help for a list of available commands.
! error getting commands pid 24643 exit 127
What the heck is going on?
this problem just happened with me after the last update of heroku CLI,
heroku CLI check if there is updates after execute any command related with and when run updates the problem occurs because is not working with root permissions.
to fix this you need to reinstall heroku CLI
sudo apt-get remove heroku
sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
curl -fL https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku
and you probably need to add this path
PATH=$PATH:~/usr/bin
export PATH
This just happened to me. I fixed it by removing the heroku app the same way i installed it. I had the gem installed, so i uninstalled that.
gem uninstall heroku
Then i used homebrew to reinstall it.
brew install heroku
and it worked.
Something similar (although with a different error message) happened to me after updating my OS. On a Mac, make sure to install the CommandLineTools (with Xcode) after a major OS update!

Heroku CLI install failing Mac OSX

Randomly my heroku toolbelt stopped working. I'm not sure why, but when I execute any heroku action, for example heroku -v this happens:
➜ Homebrew heroku -v
heroku-cli: Adding dependencies... 2.57 MB/2.57 MB
2016/04/26 12:13:42 running npm from /Users/cowan/.heroku: /Users/cowan/.heroku/node-5.10.1-darwin-amd64/node /Users/cowan/.heroku/npm-3.8.5/cli.js -v --loglevel=info
ERROR: expected npm to equal v5.10.1
Note this particular example is after I used homebrew to uninstall and reinstall heroku.
Solution in 2 steps:
Fresh install from https://toolbelt.heroku.com/osx
Restart bash/zsh

Resources