cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open siddharthsharma189b opened this issue 5 years ago • 34 comments

Added path to bin in environment variables, but still receiving this error

siddharthsharma189b avatar Jun 23 '19 07:06 siddharthsharma189b

How did you install the CLI?

RasPhilCo avatar Jul 29 '19 19:07 RasPhilCo

same here, installed with windows program.

ptrkvsky avatar Aug 30 '19 17:08 ptrkvsky

didnt work with powershell but worked with classic cmd.exe

ptrkvsky avatar Aug 31 '19 15:08 ptrkvsky

I realize this issue is a little old, but I noticed an issue while installing the app via the download link, that may be part of the problem here, too. If your PATH variable is close to 1024 characters long, the installer won't add the Heroku path to it. However, if you use scoop to install heroku-cli (scoop install heroku-cli), then a script is added to the global Scoop shims directory (which is like a node_modules/.bin directory), so you can still use heroku from the command line without any reliance on the PATH variable.

JoBrad avatar Oct 21 '19 17:10 JoBrad

I also used the Windows 64-bit installer and the CLI doesn't work for me. It installs the cli in Program Files directory but not in %LOCALAPPDATA%\heroku. I am guessing it is because of a missing shell script or something.

image

LeanKhan avatar Oct 27 '19 09:10 LeanKhan

Same issue, with diferent "ExecShell" but doesn't work. No files in %LOCALAPPDATA\heroku%.

image

Nobodyno-boop avatar Oct 29 '19 20:10 Nobodyno-boop

Same here, ticked the add to path option and the add to local files option, but it isn't in %localappdata%. I looked at the environment variables and it was there in Program Files/heroku/bin, but it still doesn't work in PowerShell or the classic cmd. image image There doesn't seem to be a good solution to this anywhere, so I'll just leave this here and abandon heroku until something happens.

GalaxySH avatar Dec 23 '19 23:12 GalaxySH

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

BAbate avatar Mar 09 '20 06:03 BAbate

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

Thank you so much!

bf616a5941b9 avatar Mar 17 '20 00:03 bf616a5941b9

It only runs when we run cmd as administrator.

Saurav-Shrivastav avatar Mar 17 '20 17:03 Saurav-Shrivastav

I closed the terminal and ran it again. Yayyyyy! It started working. Quite Strange!

Saurav-Shrivastav avatar Mar 17 '20 18:03 Saurav-Shrivastav

heroku is running on my command prompt but not running of my vs code terminal what might be the cause ??

Sammy-White avatar Apr 03 '20 21:04 Sammy-White

didnt work with powershell but worked with classic cmd.exe

Worked for me too.. Thank you

pratik0197 avatar May 03 '20 11:05 pratik0197

@Sammy-White I had the same proble. I restarted mt terminal but it didn't work out. I restarted my VS code & now it works fine for me

valekhya avatar Jul 12 '20 21:07 valekhya

If you open vcode with command then close vcode and also command prompt from where you open.open new command prompt and open v code it worked.also check Heroku path is properly set on Environment variable.

vishwaverma avatar Sep 29 '20 06:09 vishwaverma

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

thanks soo much, i did and restarted my Vscode and terminal window

myekini avatar Oct 13 '20 21:10 myekini

if some one is facing problem to check heroku command in vscode, then pls close the vscode and then start again. it will surely work.

Adebasis avatar Nov 24 '20 07:11 Adebasis

I closed the terminal and ran it again. Yayyyyy! It started working. Quite Strange!

Woah, thanks! Worked for me too! :)

sneha-nitdgp avatar Feb 02 '21 09:02 sneha-nitdgp

I had the same issue after I installed Heroku using the Windows dowloadable installer, running as Administrator.

To fix it, I had to manually edit the path variable in my user account.

Ramondy avatar Mar 26 '21 10:03 Ramondy

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

THanks mate, you just saved my day. :D

Anku-gamer avatar Apr 02 '21 11:04 Anku-gamer

It only runs when we run cmd as administrator.

Indeed, using powershell 7.1.3 as Admin did the job

ed3899 avatar Apr 02 '21 20:04 ed3899

In the environmental variables, under System variables create new path. Enter new then C:\Program Files\heroku\bin I also remove the path from User variables for Administrator. There was it before. Now is working everywhere.

mario-ibarra avatar Apr 06 '21 16:04 mario-ibarra

@Sammy-White I had the same proble. I restarted mt terminal but it didn't work out. I restarted my VS code & now it works fine for me

thankyou man this is working

pratham161 avatar May 02 '21 13:05 pratham161

@BAbate

I am running 'heroku login' through Pycharm IDE as (demo) C:\Users\Guest\PycharmProjects\demo>heroku login 'heroku' is not recognized as an internal or external command, operable program or batch file.

so implemented your solution along with setting enviormental/system variables path too; but still facing above error.

TejashriKate avatar Jun 03 '21 03:06 TejashriKate

For some reason I couldn't make the above work in any way. Instead I added it to C/Users/USER/Documents/Powershell/Microsoft.PowerShell_profile.ps1 as

$env:path = $env:path + ";C:\Program Files\heroku\bin"

komodovaran avatar Jul 21 '21 09:07 komodovaran

just restart the ide , it worked

Rrohra avatar Jul 31 '21 16:07 Rrohra

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

This method works for me! Make sure to run cmd as Admin then restart vscode and try again. Might prompt to login to Heroku.

Jake-LJH avatar Aug 20 '21 07:08 Jake-LJH

Thanks

On Fri, 20 Aug 2021 at 08:14, Jake @.***> wrote:

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH https://github.com/GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

This method works for me! Make sure to run cmd as Admin then restart vscode and try again. Might prompt to login to Heroku.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/heroku/cli/issues/1255#issuecomment-902486856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIXCRG3BMQPGKKSWU5LUPLT5X6HHANCNFSM4H2YIWXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Regards, Mario Ibarra

www.prespain.com

mario-ibarra avatar Aug 20 '21 12:08 mario-ibarra

None of the above steps working for me pls help

Ishaanthehero avatar Aug 24 '21 03:08 Ishaanthehero

Make sure to run cmd as an Admin and on your cmd. Then copy the address of Heroku bin. On your command like, enter SET PATH = %bin path% using @GalaxySH input as an example C:\Users\stefa> SET PATH = C:\Program Files\heroku\bin C:\Users\stefa> heroku --version

issue still not fixed and this is the only work-around that actually works.

Shihabaln avatar Mar 02 '22 15:03 Shihabaln