Heroku not recognized as an internal or external command (Windows)

人走茶凉 提交于 2021-02-18 08:57:06

问题


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?


回答1:


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.




回答2:


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




回答3:


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.




回答4:


I had similar problem. But closing old command prompt and opening new command prompt worked for me.




回答5:


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




回答6:


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.




回答7:


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.




回答8:


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.




回答9:


Use this it works for me "C:\Program Files\heroku\bin\heroku.cmd" create




回答10:


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.




回答11:


In my case Restarting the IDE fixed.




回答12:


If anyone experiencing this error with 'C:\Program' not recognized with heroku pg:psql -c then just do :

echo "yourcommand" | heroku pg:psql



回答13:


Install Heroku CLI through Scoop and you would be able to solve your issue




回答14:


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.




回答15:


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



回答16:


Re-installing Heroku CLI works. If not, configure in environment variables




回答17:


Try going to My computer-> Properties -> advanced System Settings

In the advanced System Settings, go to

Environment variables

Path edit

new

C:\Program Files\heroku\bin

This is working for me.



来源:https://stackoverflow.com/questions/42170691/heroku-not-recognized-as-an-internal-or-external-command-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!