Installing Heroku Toolbelt on Windows 10
Asked Answered
H

6

19

I've been having some issues installing the Heroku toolbelt on Windows 10, 64-bit.

It's the first time I install Heroku. I downloaded it from https://toolbelt.heroku.com/windows.

After installing, I tried launching a new Git Bash and typing heroku login but what I got back was bash: heroku: command not found

Running the same command on Windows Powershell, what I got back was

'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.

Any suggestions? I thought that googling those lines would help, but I haven't found much.

I followed the recommendation from here, but now when typing heroku login on the Powershell, nothing happens. Nothing changes on the Git Bash.

I checked, and the Heroku folder was added to the PATH.

I thought I'd ask for some help before installing anything else.

Thank you!

Heptad answered 25/11, 2015 at 3:48 Comment(2)
did you try a restart?Lamination
"C:\Program Files\Heroku\bin\heroku.cmd" login worked for me (Windows 10, standard command line)Oskar
C
36

bash: heroku: command not found

The error message is clear: Bash cannot find the heroku command, it's not on your PATH.

I checked, and the Heroku folder was added to the PATH.

It seems you didn't check it correctly. Note that even if it looks correct in the PATH settings window, Git Bash might have a different PATH configured. To see the PATH in Git Bash, run:

echo $PATH

When debugging path issues, it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:

/c/Program\ Files/Heroku/bin/heroku login

If this works (and it should), then you can add it to PATH like this:

PATH="$PATH:/c/Program\ Files/Heroku/bin"

Note that Heroku will likely need other programs too on the PATH, such as MySQL and Ruby. Find their absolute paths, and add there directories to PATH the same way as heroku itself in the above example.

If instead of Git Bash, you want to work in CMD, the procedure is the same, but the syntax to print and set PATH is different:

echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"
Cowskin answered 3/8, 2016 at 14:30 Comment(2)
Let us continue this discussion in chat.Cowskin
I still get the error @echo: not found and a few others even when I enter the full path /c/Program\ Files/Heroku/bin/heroku login in git Bash. Any suggestions?Snuck
E
19

In windows bash instead of this

PATH="$PATH:/c/Program\ Files/Heroku/bin" 

use this

 PATH="$PATH:/c/Program Files/Heroku/bin"
Expostulation answered 12/5, 2017 at 13:49 Comment(0)
K
4

My working solution (for git-bash especially) is:

alias heroku='winpty `where heroku.cmd`'

stored in .bashrc in home user dir and them

heroku

works as expected

Ketti answered 12/3, 2018 at 21:48 Comment(1)
It's an answer for "bash: heroku: command not found" in Windows 10 git-bash [tested on 4.4.19(1)-release (x86_64-pc-msys), from git 2.16.2.windows.1] and toolbelt heroku [heroku-cli/6.15.31-958455a (win32-x64) node-v9.3.0] and here I'm using where heroku.cmd but it can by abs path like /c/Program\ Files/Heroku/binb/heroku.cmd for better performanceKetti
T
1

If using bash from VSCode, I had to restart VSCode, after installing heroku. If not using VSCode, you probably need to restart your bash terminal, after installing heroku.

Truditrudie answered 7/5, 2019 at 6:11 Comment(0)
F
0

In Control Panel\All Control Panel Items\System (if you are using Windows), go to Advanced system settings, and there in Environment Variables, you'll find two lists, on the same window, viz. System variables, and User variables for your system. Make sure you add your path, viz. C:/Program Files/Heroku/bin, in both of these lists.

Fogdog answered 5/6, 2018 at 5:59 Comment(0)
R
0

I know this is an old thread and just want to share my solution.

Edit .bashrc for git-bash

alias heroku='"C:\Program Files\Heroku\bin\heroku.cmd" $@'
Rattlebrained answered 9/9, 2019 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.