Heroku command error .local/share/heroku/client/bin/heroku: line 21: - heroku

My heroku toolbelt had been working fine until last week that it's giving me this error on all heroku commands.
$ heroku run console -a abc
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
I didn't know that my heroku has been auto upgraded, but what has changed is I installed heroku-vi addon around the time. Not sure if it's the case.
Has anyone seen this issue before?
Noted that I installed heroku on my Mac using homebrew.

Cause:
This also happened to me, the client auto-updated but didn't do so properly:
heroku run console
heroku-cli: Updating to 6.11.14-c5f9179... 12.9 MB/12.9 MB
/Users/steves/.local/share/heroku/client/bin/heroku: line 21: /Users/steves/.local/share/heroku/client/bin/node: No such file or directory
/Users/steves/.local/share/heroku/client/bin/heroku: line 21: /Users/steves/.local/share/heroku/client/bin/node: No such file or directory
Solution:
The resolution was to re-install the client using the following (as found here https://github.com/heroku/cli/issues/485):
rm -rf ~/.local/share/heroku/client
I then checked using the status command and it re-installed correctly:
heroku status
heroku-cli: Updating to 6.11.14-c5f9179... 12.9 MB/12.9 MB
Migrating Heroku CLI v5 plugins... done
Apps: No known issues at this time.
Data: No known issues at this time.
Tools: No known issues at this time.

Heroku-error-Not a directory
Not a directory Error when executing Heroku commands
heroku
▸ stat /User/xxx/.local/share/heroku/client/bin/heroku: not a directory
▸ fork/exec /User/xxx/.local/share/heroku/client/bin/heroku: not a directory
Solution is to remove previous directory
rm -rf ~/.local/share/heroku/client

A quick workaround for me was to remove this file.
rm -rf ~/.local/share/heroku
And I was able to acces heroku console easily.

As everyone said the solution is:
deleting the heroku client with the following console command:
rm -rf ~/.local/share/heroku/plugins
But if you continue having problems you have to delete the heroku plugins folder:
rm -rf ~/.local/share/heroku/plugins
Then you can excecute the command
heroku status
To reinstall correctly
$ heroku status
heroku-cli: Updating to 6.99.0-ec9edad... 12.8 MB/12.8 MB
Apps: No known issues at this time.
Data: No known issues at this time.
Tools: No known issues at this time.

Related

heroku : #echo: command not found

I'm trying to install the heroku cli locally on win 7 -64 bit. I downloaded and ran the installer at https://devcenter.heroku.com/articles/heroku-cli#windows. I can see that the path E:/Heroku1/bin/ has been added to PATH. Using git-bash I try:
$ heroku -v
/e/Heroku1/bin/../client/bin/heroku.cmd: line 1: #echo: command not found
/e/Heroku1/bin/../client/bin/heroku.cmd: line 3: fg: no job control
How can I get this working?
I think the problem is that I may have been using an outdated git-bash. At this point in time they recommend using Git 2.8. I added the following to my path and it started working:
C:\Git28\bin;C:\Heroku\bin

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.

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

Resources