Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pub is not recognized as internal or external command

Tags:

flutter

dart

im trying to install the get_cli package for flutter.

install command is pub global activate get_cli, however pub is not a global variable on my windows 10 machine.

i think i need to add variables to the system environment variables, but i'm not sure what paths and how to call them.

this answer works for unix, so im looking for something similar for windows.

anyone got an idea?

edit: error: 'pub' is not recognized as an internal or external command, operable program or batch file.

like image 991
narrei Avatar asked Oct 03 '20 17:10

narrei


People also ask

Is not recognized internal external command?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.


1 Answers

If you have Flutter in C:\src\flutter, you can add path variable: C:\src\flutter\bin\cache\dart-sdk\bin (if you have Flutter in another localization, just replace the beginning of the path analogically) and restart your command line tool (or IDE).

You can add flutter prefix before pub as well: flutter pub global activate get_cli - according to flutter -h:

flutter pub - pass the remaining arguments to Dart's "pub" tool

like image 100
Owczar Avatar answered Sep 28 '22 18:09

Owczar