5

I want to make a Python chat bot following this article.

But after installing the heroku-cli through npm or Windows 32 bit version or Windows 64 bit version, I am getting the following error:

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

It automatically set the Path as follows when installing:

environment variables

halfer
  • 19,824
  • 17
  • 99
  • 186
Kalanka
  • 1,019
  • 2
  • 18
  • 31

6 Answers6

8

Restart your machine or restart all the processes that needed access to that variable(e.g vs code, cmd or file explorer). This happens a lot on windows after adding a directory to the PATH variable. Running processes do not receive changes made to environment variables.

machazthegamer
  • 593
  • 8
  • 18
2

While adding PATH variable do check which PATH you are adding to. There are two boxes: User Variables for administrator or System Variables.

enter image description here

If it is the top one in the image, it will work in command prompt when run only as administrator.

Hamza Zubair
  • 1,232
  • 13
  • 21
1

Restarting my machine worked for me! Solved the issue.

heroku -v 

now works.

jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
a_r_m
  • 17
  • 4
1

You only need to restart you code editor to fix this issue. After run the command again.

M.Dixon
  • 23
  • 5
0

In my case the npm uninstall -g heroku and installing it again did not work.

Even setting the path variable manually failed. So i deleted everything about heroku and installed the Heroku CLI installer from https://devcenter.heroku.com/articles/heroku-cli

It automatically made the path and installed all heroku files to the Program Files folder. After that I tried in my root project folder with Git Bash $heroku login and it worked.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

For me this command from command prompt worked.

npm install -g heroku

And then typing

heroku login 

worked.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
kraftwerk
  • 2,478
  • 2
  • 7
  • 6