我正在尝试在ubuntu 18.04上安装flutter。从link下载flutter软件包后,我设置了PATH变量,此后,每当我尝试在终端上执行flutter
时,它都会给出错误command not found
。
即使我尝试在flutter/bin
内执行flutter命令,结果仍然相同!
我尝试重新启动,然后检查结果还是一样。
这是我的 .bash_profile 的样子
rajath@rajath-Inspiron:~/Downloads/flutter/bin$ cat ~/.bash_profile
export JAVA_HOME=/usr/lib/jvm/default-java
export ANDROID_HOME=/opt/Android
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=/Downloads/flutter/bin:$PATH
错误日志:
rajath@rajath-Inspiron:~/Downloads/flutter/bin$ flutter doctor
flutter: command not found
rajath@rajath-Inspiron:~/Downloads/flutter/bin$ flutter
flutter: command not found
rajath@rajath-Inspiron:~/Downloads/flutter/bin$
任何帮助将不胜感激!!!
答案 0 :(得分:1)
您还可以将export PATH=$PATH:~/Downloads/flutter/bin
添加到~/.bashrc
中。
每次启动新bash时,都会将flutter路径添加到path变量中。
也许您应该在/usr/
附近的任何地方安装颤振器
答案 1 :(得分:0)
正如worldpotato所说,您必须添加到.bashrc文件(或.bash_profile)中
您可以运行命令
echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bashrc
和
echo 'export PATH="$PATH:~/Downloads/flutter/bin"' >> ~/.bash_profile