flutter - 如何在macos上完全卸载flutter并以正确的方式重新安装?
问题描述
在我的 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 是一个 SDK,您可以下载并解压到 Mac 的目录中。与没有自动安装过程一样,没有自动卸载过程。您通过下载一个 zip 文件并解压缩它来“安装”它。您所要做的就是删除解压缩目录的内容。
即使是能够从系统中的任何位置调用颤振命令的路径添加也必须手动完成。如果你这样做了,那么你也可以从你的 shell 的 PATH 中删除它。
您可以 rm -rf sdk 文件夹,或者如果您只想清理损坏的文件,请在 Flutter 安装目录中运行以下命令:
git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
推荐阅读
- angular - 当用户通过 Firebase Google 登录身份验证登录到 Angular 应用程序时,在存储用户的电子邮件时面临问题
- ios - ARKit - SceneView Display wrong position 3D Model
- javascript - Node.js datatables editor - How to use a (knex) VIEW that composes a join
- gtk - 来自代码的 CSS?如何直接从 Vala 使用 CSS 装饰?
- sql-server - To remove duplication of data if within 7 days
- html - How to keep a text inside a div when resizing the browser window
- python - 重新映射计数器
- ssh - Cross compilling .deb package for yocto image?i.e remot3.it
- android - 如何在 Android 3D 模型查看器中使用 .bimx 文件
- java - 两个日期之间的 Spring Boot 搜索数据