Heroku CLI install failing Mac OSX - macos

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

Related

Installing Heroku CLI on a mac

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.

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

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!

PhoneGap Mac CLI local install failed because of Node version

So I want to debug my Phonegap webapp locally in Xcode.
I follow the step here and here, and launch in MAC CLI
$ sudo npm install -g phonegap
BUT install failed and CLI result get lots of errors with the first one is :
engine phonegap#2.9.0rc1-0.12.0: wanted: {"node":">=0.10.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})
I understand my node version is too old : 0.8.8
node --version
I try to update but I am stuck with those 2 methods here and both in errors for me :
BREW
Tried Homebrew but did not work :
$ brew upgrade node
Error: node-0.8.8 already installed
NPM
As I found here
Upgrading Node.js to latest version
How do I update Node.js?
$ sudo npm install -g n
$ sudo n stable
sudo: n: command not found
In fact my bash_profile was missing the path to the n module as I found here:
cannot install npm? problems generating application
Edit your ~/.bash_profile. Add this export somewhere.
export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
I had the same issue and fixed it by upgrading node with brew, I just run
brew install --upgrade node

Migrating from a Shared Database to Heroku Postgres /

ON MAC OS X 1.7.2
I tried following the instructions https://devcenter.heroku.com/articles/migrating-from-shared-database-to-heroku-postgres
So I tried running the command on my-app:
$ heroku addons:add heroku-postgresql:dev -a my-app
-----> Adding heroku-postgresql:dev to test-biowatts... failed
! You're running an outdated version of the Heroku gem/toolbelt that cannot perform the requested action. Please update your client and try again.
So I tried to update Heroku
$ heroku update
! update is not a heroku command. See 'heroku help'.
Where
$ heroku version
heroku-gem/2.4.0
QUESTION UPDATE 1 - Heroku update now gives a different message
$ heroku update
! `heroku update` is only available from Heroku Toolbelt.
! Download and install from https://toolbelt.heroku.com
so I downloaded and installed toolbelt but the heroku update still gives the same message
QUESTION UPDATE 2 - Removed heroku installed TOOLBELT - RESOLVED
sudo rm -rf /usr/local/heroku
sudo rm -rf /usr/bin/heroku
gem uninstall heroku
then installed https://toolbelt.heroku.com/
Restarted terminal
AND IT WORKED!
Cheers,
joel
Have you tried gem update heroku?
If you are using Mac OSX mountain lion. Maybe you should better use heroku toolbelt. I had almost same issue, and it fixed after I installed Heroku toolbelt.

Resources