【问题标题】:how to completely uninstall flutter on macos and reinstall it in the correct way?如何在macos上完全卸载flutter并以正确的方式重新安装?
【发布时间】:2021-07-18 15:03:55
【问题描述】:

我在我的 macOs BigSur 上安装颤振时遇到了一个问题,因为我设置了颤振路径错误的方式,我把一切都搞砸了。

我只是想要一种方法来完全卸载颤振并以正确的方式重新安装。

ro:~ yahyasaleh$ which flutter
YAHYAs-MacBook-Pro:~ yahyasaleh$ 
YAHYAs-MacBook-Pro:~ yahyasaleh$ flutter docker
-bash: flutter: command not found
YAHYAs-MacBook-Pro:~ yahyasaleh$  echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:[/Users/yahyasaleh/Developer/flutter/bin]/flutter/bin
YAHYAs-MacBook-Pro:~ yahyasaleh$ git clean -xfd
fatal: not a git repository (or any of the parent directories): .git
YAHYAs-MacBook-Pro:~ yahyasaleh$ git stash save --keep-index
fatal: not a git repository (or any of the parent directories): .git
YAHYAs-MacBook-Pro:~ yahyasaleh$ git stash drop
fatal: not a git repository (or any of the parent directories): .git
YAHYAs-MacBook-Pro:~ yahyasaleh$ git pull
fatal: not a git repository (or any of the parent directories): .git
YAHYAs-MacBook-Pro:~ yahyasaleh$ flutter doctor
-bash: flutter: command not found
YAHYAs-MacBook-Pro:~ yahyasaleh$ rm -rf
YAHYAs-MacBook-Pro:~ yahyasaleh$ which flutter
YAHYAs-MacBook-Pro:~ yahyasaleh$ git clean -xfd
fatal: not a git repository (or any of the parent directories): .git
YAHYAs-MacBook-Pro:~ yahyasaleh$ 

【问题讨论】:

标签: flutter mobile mobile-development


【解决方案1】:

Flutter 是一个 SDK,您可以下载并解压到 Mac 的目录中。与没有自动安装过程一样,没有自动卸载过程。您通过下载一个 zip 文件并解压缩它来“安装”它。您所要做的就是删除解压缩目录的内容。

即使是能够从系统中的任何位置调用颤振命令的路径添加也必须手动完成。如果你这样做了,那么你也可以从你的 shell 的 PATH 中删除它。

您可以 rm -rf sdk 文件夹,或者如果您只想清理损坏的文件,请在 Flutter 安装目录中运行以下命令:

git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-31
    • 1970-01-01
    • 1970-01-01
    • 2014-09-01
    • 2018-09-16
    • 1970-01-01
    相关资源
    最近更新 更多