Flutter command not found

前端 未结 30 1139
独厮守ぢ
独厮守ぢ 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:02

    Do this to add flutter permanently to your path (in Ubuntu):

    1. cd $HOME
    2. gedit .bashrc
    3. Append the line:
    export PATH="$PATH:[location_where_you_extracted_flutter]/flutter/bin"
    

    in the text file and save it.

    1. source $HOME/.bashrc
    2. Open new terminal and and run flutter doctor command
    0 讨论(0)
  • 2020-11-29 17:04

    Do the following steps:

    1. Download the Flutter SDK Flutter SDK Archive

    2. Extract it where do you want (for example /home/development/flutter)

    3. Set your PATH, edit your file with this command gedit ~/.profile, you need to add this line

    export PATH=[location_where_you_extracted_flutter]/flutter/bin:$PATH

    I showed you above where I've extracted mine, so my export will look like this

    export PATH=/home/myUser/development/flutter/bin:$PATH
    
    1. Save the file and close it.
    2. Run source ~/.profile to load the changes
    3. If you run now flutter doctor should work!
    0 讨论(0)
  • 2020-11-29 17:05

    For Ubuntu 14.*

    there is no .bash_profile file but it just a .profile in /home/mangesh

    In my case,I am running this command to add flutter/bin path,

    export PATH="$PATH:/home/mangesh/Documents/flutter_data/flutter/bin/"
    

    To verify above change just run,

    echo $PATH
    

    Following is my complete output,

    mangesh@Mangesh:~$ pwd
    /home/mangesh
    
    mangesh@Mangesh:~$ export PATH="$PATH:/home/mangesh/Documents/flutter_data/flutter/bin/"
    
    mangesh@Mangesh:~$ echo $PATH
    
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mangesh/Documents/flutter_data/flutter/bin/
    
    0 讨论(0)
  • 2020-11-29 17:07

    Tried out all the above methods, but all of them lasted only until the terminal was open. So I went ahead and directly added it to the path file permanently.

    sudo nano /etc/paths
    

    add this to the file

    /Users/yourUserName/Development/flutter/bin
    

    Save the file, Tada!

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

    On macOS Catalina ,The issue is with Path

    1. Open Terminal & check the shell [command : echo $SHELL ],

    If output is /bin/bash

    We need to convert to Zsh. Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded Mac will still use Bash by default unless you change it. simply run the chsh -s (change shell) command in a Terminal window.

    [command : chsh -s /bin/zsh ]

    Enter your password when prompted. After you close the terminal window and reopen it, you’ll be using Zsh.

    1. Update your Path

    2.1. Open the zshrc file [command : vim ~/.zshrc ]

    2.2. Press 'I' to insert the path as [ export PATH=~/Dev/flutter/bin:$PATH ] ,here ~/Dev/ is the Folder where Flutter is installed

    2.3. Hit ESC Key and then :wq to save and exit the file

    1. Done ! try [command : flutter doctor ]
    0 讨论(0)
  • 2020-11-29 17:09

    I followed checked answer but when i restart the terminal, the flutter command is not recognized again. my on bash_profile path is :

    export PATH=~/Users/aldo/Projects/Framework/flutter/bin:$PATH with ~

    then i edit to

    export PATH=/Users/aldo/Projects/Framework/flutter/bin:$PATH without ~

    and re run source $HOME/.bash_profile now my flutter command is recognized event i restart the terminal. hope it's help another

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