Following this heroku tutorial to launch an app on heroku. But when I use the command heroku create
, it says it's not recognized. I added C:\Program Files\Heroku
to my PATH. How do I fix this?

- 2,387
- 4
- 29
- 59
-
same sh*t here. I tried from git bash&cmd, windows cmd and node prompt...Any progress on your part? – curveball Mar 02 '17 at 00:40
-
I tried using $heroku it is not working. then I directly type heroku and it's working now. – unidha Jun 04 '17 at 07:04
-
Any updates? The proper directories are added to my PATH and I reopened my PowerShell window. Additionally, I restarted my computer but alas, it still does not recognize Heroku as a command. – hyperupcall Jul 17 '18 at 06:40
-
For some reason my PATH was set to `C:\Program Files (x86)\heroku\bin` altough the correct path was `C:\Program Files\heroku\bin`. That fixed the problem – O-9 Mar 29 '20 at 16:15
-
1This problem usually occurs when you download the CLI, through whatever means, and don't refresh the command prompt you are using. – to240 Jan 09 '21 at 20:53
32 Answers
You're probably using an old version or the deprecated package 'heroku-cli'
. The new one is just called 'heroku'
Uninstall that by
npm uninstall -g heroku-cli
Then install the new package
npm i -g heroku
And now all your works will go perfectly.Just try heroku login
and any other heroku
command.
Credit: https://github.com/heroku/cli/issues/855#issuecomment-394758388

- 4,610
- 1
- 37
- 34
You can follow the Getting Started on Heroku with Python .
My Heroku.exe PATH is in C:\Program Files\Heroku\bin
.
Make sure your Heroku's Path is correct.
Or you can re-install the heroku.

- 289
- 2
- 10
1.Set the Path in environment variables.
2.I created a separate path: Variable name : Heroku, Variable Path as C:\Program Files\Heroku\bin. But it didn't work
3.so i added the same path in Path variable which is already created and it worked.
4.My Heroku.exe PATH is in C:\Program Files\Heroku\bin . Make sure your Heroku's Path is correct. Hope it helps.

- 385
- 4
- 4
I had this problem, after installing the heroku cli, i had to restart my commend prompt for a quick fix

- 163
- 1
- 6
Just add C:\Program Files\heroku\bin
to your Environment Variables
.
Make sure to close and re-open the shell or cmd.

- 2,594
- 4
- 26
- 36
I had similar problem. But closing old command prompt and opening new command prompt worked for me.

- 186
- 2
- 3
After installed heroku, just close the vs code. Reopen vs code, on the terminal type,
heroku --version

- 81
- 1
- 3
Based on the documentation, This installation method is required for users on ARM and BSD. You must have node and npm installed already. So just install the package using npm.
npm install -g heroku
Then in your terminal, type heroku --version will surely work fine.

- 526
- 4
- 11
I can see the same issue with Windows 10 Home.
- Open Windows Powershell
- type $env:PATH
Is your Heroku path actually there? If not follow these steps:
- Open the Start Search, type in “env”, and choose “Edit the system environment variables”
- Click the “Environment Variables…” button
Now check values for your Heroku inside both "User" and "System" "Path" variables.
Add your Heroku path where not listed. Works immediately with no any system restart.

- 34
- 6
-
-
1Also in the case that the heroku path exists in path variables but still doesn't take effect immediately, you can restart the machine as it may work when you do. – Doreen Chemweno Mar 26 '20 at 01:04
-
this did it for me! I had Heroku in my User but not in my System Path – Gabriela Catalina Sep 30 '20 at 18:54
Go to bin directory and run heroku application and then type "heroku login " for login or other commands
Really don't know why Powershell not identifying Heroku ,but the above hint will work.

- 13
- 1
- 2
I faced this issue when I tried heroku command inside a command line window that was opened prior to installing the heroku CLI.
Simply running the command in a new command line window solved it for me.

- 749
- 9
- 10
I encountered this issue. I closed all existing command prompt/terminal and opening new command prompt, it did the work.

- 81
- 1
- 8
- Download heroku CLI from here
- Install it
- Close all the terminal tabs and restart your IDE Boom

- 953
- 8
- 14
It worked with git bash.
Run this command:
npm install -g heroku
on git bash, then try heroku login on bash.

- 23,672
- 5
- 40
- 80

- 11
- 1
-
I followed the other steps (involving environment variables), but those did not fix it for me. This one works and allows us to quickly upgrade the CLI! – David Zwart Jul 10 '22 at 07:04
If anyone experiencing this error with 'C:\Program'
not recognized with heroku pg:psql -c
then just do :
echo "yourcommand" | heroku pg:psql

- 748
- 1
- 8
- 19
Set the path in Environment variables.
C:\Program Files\Heroku\bin
After setting path, still the same errors occurs.
Restart the system and sometimes this happens. Try this also if setting path didn't work.

- 733
- 8
- 9
oh no worries u may have forgotten the path or haven't installed heroku yet
npm install -global heroku
or try deleting the previously depreciated package and reinstall it again
npm uninstall -global heroku-cli
Late arrival tip: if you have a separate administrator account (which you use to install new products), note that it probably added the path to your admin account but not your other account(s), which you actually intend to run it from. Add the path to the "system variables" section instead of the admin user section.

- 703
- 1
- 6
- 17
If you have checked in PATH that C:\Program Files\Heroku\bin is set. You need to close and reopen your terminal again

- 95
- 9
There was another post here Heroku won't load within Visual Studio Code I did that and it worked for me. After uninstalling and npm i -g heroku

- 21
- 6
I had the same problem
install Heroku from official site. close the terminal and open it again
type heroku --version
If your environment variable path is ok just refresh your terminal and it will work. I had the same issue and it worked for me.

- 1
This worked for me:
$'curl https://cli-assets.heroku.com/install.sh | sh'

- 25,369
- 29
- 96
- 135