Flutter install in windows environment variable - flutter

I have problem when trying to install the flutter in my desktop first I get error of :
is not recognized as an internal or external command operable program or batch file.
Then I open the system environment variable and add the flutter to the user variables path plus I add all of the flutter, git, system32 to systems variables path section.
Unfortunately, the problem is still present even with a restart.
Now when I type flutter doctor to Command prompt No results are shown and I cannot write an extra line.

Welcome to stackoverflow!
You should take these steps:
Open RUN by shortcut (WINDOWS_KEY+R_KEY)
Type in RUN SystemPropertiesAdvanced.
System Properties dialog should appear, click Environment Variables.
In User variables (The Top section) select Path and click Edit.
Add the new path to flutter Binary folder like this C:\flutter\bin.
Select OK, and OK again in Environment Variables, and OK in System Properties.
Close any Command prompt you using and reboot the system.
Hooray, :D now flutter is successfully installed.

Related

Navigate to folder directly before i can use command in in a command line

I don't know how to search for my problem here.
In the command line i must navigate everytime directly in the folder where the software was installed.
Before I can use the command "java -v" or "flutter doctor" or what ever i must navigate to the java or flutter folder and i don't know why.
Maybe someone of you knows the ONE solution.
I use windows 11. I think it might be due to the environment variables - the environment variables entered are automatically deleted all the time.

i get this notification in terminal, when want to run dart in terminal , I'm a beginner

enter image description here
notif in terminal:
The command dasar_dartpt2.dart was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\dasar_dartpt2.dart". See "get-help about_Command_Precedence" for more details.
You can't run a .dart file directly, you would need to run dart dasar_dartpt2.dart (and for this to work, your Dart SDK needs to be listed in your PATH environment variable).
A simpler way to run the script is to click the Run link just above your main function. Or you can use the Debug link which will run with a debugger that will let you debug and inspect the script at runtime. Using these links (or the Run menu in VS Code) passes the request to the Dart extension which can provide features you won't get when just running the script directly in a terminal.

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

I tried to activate very_good_cli in flutter with this command:
dart pub global activate very_good_cli
and result was this:
...
...
...
Building package executables...
Built very_good_cli:very_good.
Installed executable very_good.
Warning: Pub installs executables into ~\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
I also added ~\AppData\Local\Pub\Cache\bin to system Path, but this warning still persists and the error I get is:
'very_good' is not recognized as an internal or external command,
operable program or batch file
how can I solve this?
I just wanted to quickly put this together to make it obvious.
After running...
dart pub global activate very_good_cli
very_good.bat is added to your ~\AppData\Local\Pub\Cache\bin directory. So, you need your command-line shell to pick up on this change.
As mentioned above, if you run dart pub global activate very_good_cli a second time it will give you some good info in the form of a warning
Warning: Pub installs executables into `~\AppData\Local\Pub\Cache\bin`, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated very_good_cli 0.7.2.
So, if the warning states the ~\AppData\Local\Pub\Cache\bin is not in your path, you need to add it there. Something like this. This essentially allows your command-shell to recognize 'very_good' as a command.
Link to video showing the process of adding to path
Once you are done with that, you need your command-line shell(s) to pick up the change. Easiest way to do that is to close them completely and reopen them. A tricky situation you might run into is if you are using a shell inside of another process. I use powershell terminal in vscode. So, I had to close vscode to actually refresh the terminal.
Restarting your computer is the nuclear button that should get the issue resolved if your Environment Variables are setup correctly or if there isn't some other wonky issue with the shell you are using. Using the built in windows cmd is a good test to see if it is just a problem with your preferred shell.
So after running dart pub global activate very_good_cli and adding path to ...\Pub\Cache\bin to the Path in system environment variables, restarting the windows solved the issue.

'flutter' is not recognized in windows cmd prompt with elevated permissions

Flutter path is correct but still unable to be recognized by the windows command prompt. Looked everywhere asked anyone who used flutter still unable to figure out the problem.
Tried suggestions made on other questions similar to this still no luck and followed the tutorials on installing flutter did not work.
For Windows users (Windows 10)
Open Start menu and type env
Click on Environment Variables..
under User variables, select Path then click Edit
Click New then past this line C:\src\flutter\bin(supposing this is where 'bin' directory of Flutter is located on your machine)
Click 'OK'.
Restart is required to apply changes.
The command prompt you're using appears to be using elevated permissions and therefore will have the "system" environment variables but not your user ones necessarily. Try with a non-elevated command prompt... which you should be using anyways. Only use an elevated command prompt when absolutely needed as otherwise you could delete important things by accident. Also, you can run echo %PATH% to see what is actually in the path in the command prompt you're using.
If you want to use flutter across multiple users or need to use an elevated command prompt for some reason, add the path to flutter/bin to the system environment variables instead.
Adding the following things in the path solved the issue for me
C:\Program Files\Git\bin
C:\Program Files\Git\cmd
C:\Windows\System32
C:\Windows\SysWOW64\WindowsPowerShell\v1.0
C:\src\flutter\bin
For windows user make sure to include C:\Windows\System32 in your user PATH variable,this prevents the flutter command prompt from flashing when you click it.

PhoneGap command not recognized

I have followed the directions on PhoneGap's website and installed PhoneGap using the command prompt on Windows. However, after it has installed I try to run the command 'phonegap' and I get an error saying that 'phonegap' is not recognized as an internal or external command, operable program or batch file. How do I fix this? Thanks.
You might need to add phonegap to your classpath variable, in order to let the prompt know where the phonegap .exe file is located.
Try writing the full path of the exe file, if that runs, then what I mentioned above should solve your problem.
EDIT
Just looked at the install page at phonegap.com (http://phonegap.com/install/). Very scarce on the information I would say.. But I still recommend investigating the above.
The Problem with enthronement variable for default path of your your current user. Follow the steps.
Click the Start menu and type "regedit" on the search box. This will launch the Windows Registry Editor program.
Enter to the following Registry entry: HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
Select the "Enabled" entry in the right side window. If this entry is there, right-click and select "New" followed by "DWORD Value." Name the value "Enabled."
Right-click the "Enabled" entry and click "Modify."
Change the number in the "Value" box to "1." This will re-enable WSH.
close all opened cmd windows and open a new window.
Just try to run CMD as administrator. Hopefully that will solve your problem. This solved mine.
Even though this is a very old question, I'm going to post a solution that worked for me on Windows Vista/7/8. The problem is that by default the command prompt in which the npm command is run is not elevated. So launch a command prompt as administrator and then run npm command. If it is not elevated then the environment variables wont be set properly.
In windows 7 platform, when the latest version of phonegap (3.4) installed it hosts in path like this:
C:\Users\\AppData\Roaming\npm
Sometimes you should add this address to the PATH environment manually.
Go to System Properties-> Advanced -> Environment Variables
Select PATH variable from list and then edit it