Flutter command not found

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

    For Linux: To remember flutter commands permanently:

    1.) open up terminal and cd to $HOME. for eg: username@linux:~$

    2.) open the hidden file .bashrc with your desired editor. It resides in $HOME.eg. sudo gedit .bashrc

    3.) add the following line export PATH=/home/username/flutter/bin:$PATH somewhere as a newline in .bashrc file preferably as the last line edit & save the file.

    4.) run source /home/yourname/.bashrc in terminal to process your recent changes.

    5.) finally, run echo $PATH to see flutter dir is in your system path along with other such paths. for eg: /home/username/flutter/bin

    @Happy_Coding.

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

    Open your .bash_profile file located under Finder>Go>Home. Add below lines at the end of

    export PATH=$PATH:/Users/Projects/Flutter/sdk/bin
    

    Don't forget to replace /Users/Projects/Flutter/sdk/bin with your flutter path.

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

    You can easily create a symbolic link as below,

    sudo ln -s /opt/flutter/bin/flutter /usr/bin/flutter
    

    I had moved flutter into /opt/ folder after downloading, so replace with the path you have flutter directory.

    flutter command should work even after rebooting your machine.

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

    I faced this problem and I resolved it following these steps:

    1. : nano ~/.bash_profileexport

    2. : add this line: PATH=/Users/user/Documents/flutter_sdk/flutter/bin:$PATH make sure the dir to your flutter bin is correct.

    3. :source ~/.profile

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

    Just revert to chsh -s /bin/bash from chsh -s /bin/zsh,

    Run one command

    chsh -s /bin/bash
    

    Your facing this problem just because of you have change shell from /bash to /zsh in macOs. If you run this command again it will change the path again. So just run one command and problem solve.

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

    Flutter SDK can be run on windows as well ass macOs

    For Windows

    1. First download the lates SDK from flutter download page.
    2. Now to run flutter in windows console you need to update your PATH environment variable.
    3. From the Start search bar, type ‘env’ and select Edit environment variables for your account.
    4. Under User variables check if there is an entry called Path:

      1.If the entry does exist, append the full path to flutter\bin using ; as a separator from existing values.
      2.If the entry does not exist, create a new user variable named Path with the full path to flutter\bin as its value.
      

    For Mac

    1. First download the lates SDK from flutter download page

    2. Extract the file in the desired location using following commands :

      1. cd ~/development
      2.unzip ~/Downloads/flutter_macos_v1.5.4-hotfix.2-stable.zip
      
    3. Add the flutter tool to your path:

      1.export PATH="$PATH:`pwd`/flutter/bin"
      

    Run flutter doctor

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