Trouble installing flutter on macOS High Sierra
Quick fix:
export PATH=$PATH:/Users/Jake/flutter/bin
flutter doctor
Permanent fix:
Assuming you are using bash
shell,
cd $HOME
touch .bashrc
if it is not there- Add
Quick fix line 1
as last in.bashrc
file - Open new tab and check
flutter doctor
. It should work
Please lemme know if it didn't work
Jake
Work email: jake(at)squaredsoftware.co.uk Please support me by downloading my new iOS application, travelrecce!
Updated on December 06, 2022Comments
-
Jake over 1 year
I’ve been following a tutorial at this address but still can’t seem to run
flutter doctor
once I’ve finished and successfully runecho $PATH
The only reason I can think of is because I might have needed to initially change my directory to the flutter folder, and not the user folder but I doubt this would make any real difference.
I've contacted the author of this tutorial and he said that another user found this helpful;
I managed to solve it myself after I began looking into 'fish'. Apparently I had to declare the path in "~/.config/fish/config.fish" rather than "~/.bash_profile" and then of course run "source ~/.config/fish/config.fish" rather than "source ~/.bash_profile"
This is what my Terminal is looking like;
MacBook-Air:~ jake$ cd /users/jake/ MacBook-Air:jake jake$ touch .bash_profile MacBook-Air:jake jake$ source $HOME/.bash_profile MacBook-Air:jake jake$ echo $PATH /flutter/bin:/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin:/Users /jake/.composer/vendor/bin MacBook-Air:jake jake$ flutter doctor -bash: flutter: command not found
I'm expecting something like this;
Many thanks, Jake
-
Dinesh Balasubramanian over 5 yearsWhere is flutter located in your machine?.. (in my machine, it's in
~/Downloads/flutter
) -
Jake over 5 yearsMine’s located in ~Users/Jake/flutter
-
-
Jake over 5 yearsHow do you want me to run this? Do you want me to run it in
sudo nano .bash_profile
? Also I don't know how to add it to.bashrc/.zshrc/.fishrc
as I'm very new to this environment. -
Jake over 5 yearsNo, It says
= is not a valid identifier
and/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin:/Users/Jake/flutter/bin': not a valid identifier
-
Dinesh Balasubramanian over 5 yearsCan u open new tab/window and try
-
Dinesh Balasubramanian over 5 yearsCan u run this
echo $0
and tell the result -
Jake over 5 yearsIt says
-bash
-
Dinesh Balasubramanian over 5 yearsDo u have file named
.bashrc
at your home directory (/Users/Jake/) -
Jake over 5 yearsNo I don't, if I need to add this can you show me how?
-
Dinesh Balasubramanian over 5 yearsI'm trying to understand the current status of your machine.. can u open new tab and
echo $PATH
and show the result here -
Jake over 5 yearsHere's what I get
/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake/.composer/vendor/bin
-
Jake over 5 yearsJust to let you know, I purchased this machine just last Wednesday and haven't done anything like this in the past on this laptop other than install Git
-
Dinesh Balasubramanian over 5 yearsI updated answer by removing spaces. Can u try the first two lines now
-
Jake over 5 yearsOkay this looks good, it's now downloading Dart SDK from flutter engine, I'll let you know how it goes when its finished
-
Jake over 5 yearsThis worked great, thank you for your patience with me :)