Cli: Heroku command can't run on window after installed

Created on 9 Sep 2017  Â·  38Comments  Â·  Source: heroku/cli

So i try to deploy my API by using heroku but after i download the heroku toolkit on heroku website and installed it. When i run heroku login. The error popped up and say
bash' is not recognized as an internal or external command,
operable program or batch file.
Any one know how to fix this problem?

Most helpful comment

if u have just installed heroku and it doesnot work just close your currently open terminal or cmd and start the cmd again....it worked for me..hope it works with u all..thnx

All 38 comments

I have the same issue. Did you already solve it?

On Thu, Sep 21, 2017 at 11:37 AM Canvox notifications@github.com wrote:

I have the same issue. Did you already solve it?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/heroku/cli/issues/600#issuecomment-331244596, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AbwzIqXMnBQ5xrBce9Jg3BXP4Ck2JKLxks5skqzsgaJpZM4PR4Lr
.

I solved it like 3 weeks ago. Check the path of heroku to see if its match
sometimes installation doesnt provide the correct path. Also make sure you
install the correct version. For me its path problem

Thanks I'll check it out

On Thu, Sep 21, 2017 at 11:41 AM Canvox notifications@github.com wrote:

Thanks I'll check it out

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/heroku/cli/issues/600#issuecomment-331245524, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AbwzItCoJLiXdRLR6n9yhftDRnhvwSIrks5skq3DgaJpZM4PR4Lr
.

locate the heroku folder and right click the heroku.ex to see the path and
add that path to the command line and run its again to see if it runs

Which heroku.exe, the one from the bin folder or the client folder?

On Thu, Sep 21, 2017 at 11:46 AM Canvox notifications@github.com wrote:

Which heroku.exe, the one from the bin folder or the client folder?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/heroku/cli/issues/600#issuecomment-331246825, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AbwzItz-Q963bYaZn_Mvasq2ljqB-qYKks5skq7vgaJpZM4PR4Lr
.

the bin folder. Add that path to the environment and probably it will work.

Thanks I did and it worked. Is there any way to run the commands from outside this path? (my teacher told me that the idea of Heroku is to execute it from any directory of my computer)

On Thu, Sep 21, 2017 at 11:51 AM Canvox notifications@github.com wrote:

Thanks I did and it worked. Is there any way to run the commands from
outside this path? (my teacher told me that the idea of Heroku is to
execute it from any directory of my computer)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/heroku/cli/issues/600#issuecomment-331248277, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AbwzIljtesw3ud-qxabYOadH9ugjGIEGks5skrBKgaJpZM4PR4Lr
.

im not sure🤔🤔You can use git bash usually installation of heroku they
always include git bash which you can run it without the correct path in
the environment. The last time i test it it regconized the command but once
i try to login it said that the command for login doesnt support in here.
But for me if it just for deployment and testing purpose cmd still good
enough :D

Thanks, I'm going to continue testing and playing with it. I'll let you know

Can you provide me a link with the git bash commands to run Heroku?

Update: For anyone going through the same problem, you can configure an environment variable to your Path in Windows. By doing this, you should be able to run heroku commands from any directory in the console. Here is a youtube video that explains how to do this https://www.youtube.com/watch?v=W9pg2FHeoq8

When you download heroku from the main website it always installs git and
git bash into the system. I wonder why you didnt get it

On Sep 21, 2017 9:28 PM, "Canvox" notifications@github.com wrote:

Can you provide me a link with the git bash commands to run Heroku?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/heroku/cli/issues/600#issuecomment-331347080, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AbwzIoln0jNiNU-Mutam7hnxKgXKtC7qks5skzeDgaJpZM4PR4Lr
.

Closing, but let us know if this is still an issue for you by reopening the ticket.

Hye Guys,
I have tried following the comments. But unfortunately none worked!! So I traced back the path for the error and did the following steps:-

  1. Uninstalled Heroku-CLI via control panel
  2. Deleted .config/Heroku file as well as folder
  3. Went to the site https://devcenter.heroku.com/articles/heroku-cli#download-and-install , scrolled down to the CLI for windows section
  4. Downloaded the CLI and installed it on My machine. Remember in this Git does not come Bundled within
  5. Now try heroku login (it should probably work)
  6. If that works just check for git --version. If it doesn't work just set the path in Environment Variables to the Git path. Mostly this would be 'C:\Program Files\Git\bin'.
    Now, Try on going with further steps they must work now.

I've solved this problem by running cmd as administrator. Strange that it only happens with heroku, while other programms like git, node, npm never had this issue.

Thanks friend. It works for me when I run the cmd as administrator.

if u have just installed heroku and it doesnot work just close your currently open terminal or cmd and start the cmd again....it worked for me..hope it works with u all..thnx

I've solved this problem by running cmd as administrator. Strange that it only happens with heroku, while other programms like git, node, npm never had this issue.
@Hatshepsut93
That did the trick for me too! And it's quite weird indeed...

When I try it in Git bash I get:
bash: heroku: command not found

I try and add the path according to what people here wrote. I have two "bin" folders in my heroku folder.

  1. heroku/bin
  2. heroku/client/bin
    None of them have a file called heroku with the extension .exe (or .ex like someone wrote). However they have a file of type: file that is called heroku. Anyway I try and add the path to both bin folders and still get the same result (I also tried the client folder):
    bash: heroku: command not found

Anyway in the Cmd I can work with heroku. Just wish it would work and want to know whats wrong.

@mikael1000 try reinstalling

I have a similar problem. When I installed heroku it said that the PATH variable was truncated and now I can't use the interface in my Windows command line. What do I do?

set PATH="C:\Program Files\Heroku\bin;%PATH%" has solved this issue for me.

set PATH="C:\Program Files\Heroku\bin;%PATH%" has solved this issue for me.

This worked for me as well! Thanks

Closing and opening CMD worked for me too! 😄

if heroku [-command] is not working you can also try npx heroku [-command]

if heroku [-command] is not working you can also try npx heroku [-command]

Can you explain how to do this?

Okay I just closed and opened the CMD and it worked. What's the magic behind this. Could be a problem from heroku or CMD?

please help me my heroku is command not found
i have VSCode with gitbash, i install nodejs herokucli but when i type from the command line the syntax it says command not found

If you are on a windows machine, you should download heroku and save the folder in your directory. E.g if your app name is My-app, you should save the heroku folder by clicking on the browser section to select where you wanna save the folder (My-app) during installation.
Once you are done, cd into My-app. Then type heroku to verify if its working if it's not, just simply close the command prompt and reopen it, cd into My-app once more, it will work. It worked fine for me

I was able to fix it by making sure PowerShell's PATH was update:

$ENV:PATH="$ENV:PATH;C:\Program Files\heroku\bin"

This may have resolved itself by rebooting or just killing the terminal.

I was able to fix it by making sure PowerShell's PATH was update:

$ENV:PATH="$ENV:PATH;C:\Program Files\heroku\bin"

This may have resolved itself by rebooting or just killing the terminal.

This worked for me

when I close the Vs code and re-open the Vs code after that Heroku working Fine for Me.

if u have just installed heroku and it doesnot work just close your currently open terminal or cmd and start the cmd again....it worked for me..hope it works with u all..thnx

Thanks. It worked for me in powershell.

I've solved this problem by running cmd as administrator. Strange that it only happens with heroku, while other programms like git, node, npm never had this issue.

lol, that's next level fixing. That's it, thanks!

should we install heroku in the drive where our project folder is residing?

when I close the Vs code and re-open the Vs code after that Heroku working Fine for Me.

`Thank you , simple solution but , trust me I spent hours to figure it out, and then your comment saved me...now is working...YES

when I close the Vs code and re-open the Vs code after that Heroku working Fine for Me.

dude, that worked for me to!!! thank you so much

I also had a problem with Heroku and found a fix for it.
I use my computer on a regular user account and when I was installing heroku it was adding the path to my admin account and not my user account. Luckily I noticed it and was able to add the correct path for my user account.

Hope this helps someone!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sf-jd picture sf-jd  Â·  5Comments

pushcx picture pushcx  Â·  7Comments

omarcostahamido picture omarcostahamido  Â·  4Comments

zeke picture zeke  Â·  7Comments

imujjwal96 picture imujjwal96  Â·  6Comments