Trouble installing flutter on macOS High Sierra

2,256

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

Share:
2,256
Jake
Author by

Jake

Work email: jake(at)squaredsoftware.co.uk Please support me by downloading my new iOS application, travelrecce!

Updated on December 06, 2022

Comments

  • Jake
    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 run echo $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; expected result of flutter doctor

    Many thanks, Jake

    • Dinesh Balasubramanian
      Dinesh Balasubramanian over 5 years
      Where is flutter located in your machine?.. (in my machine, it's in ~/Downloads/flutter)
    • Jake
      Jake over 5 years
      Mine’s located in ~Users/Jake/flutter
  • Jake
    Jake over 5 years
    How 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
    Jake over 5 years
    No, It says = is not a valid identifier and /flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/U‌​sers/jake/.composer/‌​vendor/bin:/Users/Ja‌​ke/flutter/bin': not a valid identifier
  • Dinesh Balasubramanian
    Dinesh Balasubramanian over 5 years
    Can u open new tab/window and try
  • Dinesh Balasubramanian
    Dinesh Balasubramanian over 5 years
    Can u run this echo $0 and tell the result
  • Jake
    Jake over 5 years
    It says -bash
  • Dinesh Balasubramanian
    Dinesh Balasubramanian over 5 years
    Do u have file named .bashrc at your home directory (/Users/Jake/)
  • Jake
    Jake over 5 years
    No I don't, if I need to add this can you show me how?
  • Dinesh Balasubramanian
    Dinesh Balasubramanian over 5 years
    I'm trying to understand the current status of your machine.. can u open new tab and echo $PATH and show the result here
  • Jake
    Jake over 5 years
    Here's what I get /flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/U‌​sers/jake/.composer/‌​vendor/bin
  • Jake
    Jake over 5 years
    Just 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
    Dinesh Balasubramanian over 5 years
    I updated answer by removing spaces. Can u try the first two lines now
  • Jake
    Jake over 5 years
    Okay this looks good, it's now downloading Dart SDK from flutter engine, I'll let you know how it goes when its finished
  • Jake
    Jake over 5 years
    This worked great, thank you for your patience with me :)