Flutter command not found

前端 未结 30 1142
独厮守ぢ
独厮守ぢ 2020-11-29 16:54
bash: flutter: command not found

Apparently, none of the flutter commands are working on the terminal of an android studio which I believe I am tryi

相关标签:
30条回答
  • 2020-11-29 17:10

    If you are using zsh, you need to follow below steps in mac.

    • Download latest flutter from the official site.
    • Unzip it and move to the $HOME location of your mac.
    • Add to path via .zshrc file
    • run nano ~/.zshrc into iTerm2 terminal.
    • export PATH=$HOME/flutter/bin:$PATH
    • Save and close ~/.zshrc file.
    • re-start iTerm2
    • Now you will have flutter available.

    If this help please upvote :)

    0 讨论(0)
  • 2020-11-29 17:10

    You must have .bash_profile file and define flutter path in .bash_profile file.

    1. First of all, if you do not have or do not know .bash_profile, please look my answer: How do I edit $PATH (.bash_profile) on OSX?

    2. You should add below line(.../flutter_SDK_path/flutter/bin) in your .bash_profile

    export PATH=$PATH:/home/username/Documents/flutter_SDK_path/flutter/bin

    After these steps, you can write flutter codes such as, flutter doctor, flutter build ios, flutter clean or etc. in terminal of Macbook.

    @canerkaseler

    0 讨论(0)
  • 2020-11-29 17:10

    After you followed the tutorial, if your mac is not even able to run "flutter doctor", you should reboot your mac. This worked for me.

    0 讨论(0)
  • 2020-11-29 17:13

    The flutter installation guide says you add this:

    export PATH="$PATH:pwd/flutter/bin"
    

    VSC doesn't support pwd for some reason. The fix:

    export PATH="$PATH:~/flutter/bin"
    
    0 讨论(0)
  • 2020-11-29 17:14

    If you are on MAC OS

    First find the location of your flutter sdk

    Flutter SDK File: Write the below command on your terminal to download the flutter sdk

    git clone https://github.com/flutter/flutter.git
    

    For example: the SDK file name is flutter and it is in Downloads

    Close and open your terminal again

    and enter the following commands in your terminal

    cd Downloads     #go to Downloads
    
    cd flutter   #go to flutter
    
    pwd       #/Users/[USERNAME]/downloads/flutter/
    
    whoami      #Your [USERNAME]
    
    export PATH="/Users/[USERNAME]/downloads/flutter/bin":$PATH
    

    I hope you will manage on based on the example I have given. Upvote the answer if you find it useful.

    0 讨论(0)
  • 2020-11-29 17:15

    Mac OS Mojave; Wireshark Path problem

    As I can't comment, I'm answering:

    In your terminal, run:

    touch $HOME/.bash_profile
    
    vi $HOME/.bash_profile
    

    Now use I to insert and paste the following:

    export PATH="$PATH:$HOME:/PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin"
    

    Use esc and type :wq! to save the file and exit.

    Refresh:

    source $HOME/.bash_profile
    

    And verify it's OK by running:

    echo $PATH
    
    0 讨论(0)
提交回复
热议问题