我在我的macOs BigSur上安装flutter时遇到了一个问题,因为我把flutter的路径设置错了,把一切都搞砸了。
我只是想要一种完全卸载flutter并以正确的方式重新安装它的方法。
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$ 发布于 2021-04-25 02:49:33
Flutter是一个SDK,您可以将其下载并解压缩到Mac中的目录中。没有自动卸载过程,就像没有自动安装过程一样。你通过下载一个zip文件并解压缩它来“安装”它。您所要做的就是删除您将其解压到的目录的内容。
即使是能够从系统中的任何位置调用颤动命令的路径添加,也必须手动完成。如果你这样做了,那么你也可以将它从你的shell路径中删除。
您可以rm -rf sdk文件夹,或者,如果您只是想清理损坏,请在Flutter安装目录中运行以下命令:
git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctorhttps://stackoverflow.com/questions/67246319
复制相似问题