I have been trying to open a new Flutter Project in VS Code using the command palette. The output shows:
"flutter create --ios-language swift --android-language kotlin .
/usr/bin/env: ‘bash’: No such file or directory
exit code 127
"
How to solve it?
/usr/bin/env: ‘bash’: No such file or directory exit code 127
The VS Code extension tries to spawn Flutter using shell execution, and is trying to run bash. I suspect your PATH environment variable has been set incorrectly and no longer contains a valid bash binary.
Related
I have recently started writing my LaTeX documents in VScode on my Mac running Big Sur.
I am able to build my .tex files without issue using the built in "Build LaTeX project" option (the green arrow -- short cut OPT+CMD+B). When I try to build the .tex file with CMD+SHIFT+B, however, the terminal pops up with the following text:
Executing task: msbuild /property:GenerateFullPaths=true /t:build /consoleloggerparameters:NoSummary
zsh:1: command not found: msbuild
The terminal process "/bin/zsh '-c', 'msbuild /property:GenerateFullPaths=true /t:build /consoleloggerparameters:NoSummary'" failed to launch (exit code: 127).
Terminal will be reused by tasks, press any key to close it.
Despite this, the .tex file is still built as normal. My question is: why is this happening and how do I fix it?
Thanks!
When I tried to run Flutter app on windows, it gives an error then says Exited Sigterm. or stmh like this.
the error says;
Re-run cmake with a different source directory
cmake files does not match...
etc.
The Steps that helped me to handle this error are;
open your terminal then write following commands
flutter clean
flutter pub get
flutter run
This will remove you build file and re-create it.
Your problem should have solved now.
I am getting the following error when executing flutter doctor command in PowerShell:
Program 'flutter' failed to run: No application is associated with the specified file for this operation.
I have already set the environment variable for Flutter/bin, Git and Windows/System32.
Flutter commands work fine on normal cmd, but not in PowerShell which is the default in VS Code.
How to fix this?
So I'm currently following a tutorial on flutter and it showed this nifty way of running dart code in the same project by creating the new file in the app directory instead of the lib folder. I'm using VS code and can't really figure out how to run the file (they used Android Studio). I tried running the file in the terminal and it kept saying
./scratch.dart: line 1: syntax error near unexpected token `('
./scratch.dart: line 1: `void main() {'
Any idea what I'm doing wrong?
Run dart in terminal to Check that you have dart installed globally with global environment variable in your terminal. If not follow this doc to install https://dart.dev/get-dart.
After making sure that you have dart SDK installed globally in your PC, you can run any dart file containing a void main function in a terminal like
~$ dart path_to_file/scratch.dart
Note: Running un terminal will not work if you are working with a package that utilize dart:ui
I have installed flutter and set up the path with the zsh file for Catalina version of mac however when I run flutter doctor or flutter precache, I receive zsh: command not found: flutter. NOTE: I managed to get through these steps previously and set up android studio however I had issues when I tried to connect the simulator for Xcode and now I have had to start again.
UPDATE: When running 'flutter' or 'flutter doctor', I receive this error: Error when reading '../../../../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory and it says that pub upgrade failed after 10 tries.
How would I solve this?
When I run ls -a in the home directory, I see that there's a .bash_profile, a .zshrc file and a .zprofile (which I created previously) in there. Is this related to the problem?
This looks like you don't have flutter on your PATH in ZSH.
Open your .zshrc file in your terminal with
nano .zshrc
You should see the following at the top of the file
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
Add on the second line the path to the bin directory of your flutter SDK location, like mine:
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/joaosoares/Projects/flutter/bin