返回顶部
首页 > 资讯 > 精选 >消除Flutter doctor的警告Warning: `dart` on your path resolves to xxx/bin/dart
  • 317
分享到

消除Flutter doctor的警告Warning: `dart` on your path resolves to xxx/bin/dart

FlutterDartmacos 2023-08-21 11:08:59 317人浏览 八月长安
摘要

文章目录 问题描述解决方案 问题描述 最新更新了Flutter SDK到最新版本,然后使用doctor命令检查环境发现以下警告. wangyangyangdeMacBook-Pro:fusion_pro wangyang$ fl

问题描述

最新更新了Flutter SDK到最新版本,然后使用doctor命令检查环境发现以下警告.

wangyangyangdeMacBook-Pro:fusion_pro wangyang$ flutter doctor -v[!] Flutter (Channel stable, 3.7.9, on macOS 12.6.5 21G531 darwin-x64, locale zh-Hans-CN)    • Flutter version 3.7.9 on channel stable at /Users/wangyang/Developer/develop_env/flutter_3.7.9    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.13.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at      /Users/wangyang/Developer/develop_env/flutter_3.7.9. Consider adding /Users/wangyang/Developer/develop_env/flutter_3.7.9/bin to the front of your      path.    • Upstream repository https://GitHub.com/flutter/flutter.git    • Framework revision 62bd79521d (5 weeks aGo), 2023-03-30 10:59:36 -0700    • Engine revision ec975089ac    • Dart version 2.19.6    • DevTools version 2.20.1    • Pub download mirror Https://pub.flutter-io.cn    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perfORM update checks and      upgrades.

解决方案

Warning: dart on your path resolves to /usr/local/Cellar/dart/2.13.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at
/Users/wangyang/Developer/develop_env/flutter_3.7.9. Consider adding /Users/wangyang/Developer/develop_env/flutter_3.7.9/bin to the front of your
path.

看警告提示是检查到了单独的Dart SDK,不是在Flutter SDK之中,建议我们将Flutter中的Dart路径添加到环境变量中。
说白了就是系统中存在了2个Dart SDK,我们只需要将单独的Dart SDk删除就好。

根据路径Cellar,我们判断出这是以前使用homebrew安装的Dart。
我们使用brew list查看是否安装过.
在这里插入图片描述
发现确实安装过, 我们使用brew remove dart来卸载Dart.

wangyangyangdeMacBook-Pro:~ wangyang$ brew remove dartUninstalling /usr/local/Cellar/dart/2.13.3... (508 files, 477MB)

可以看到卸载的路径正好对应了警告中的路径,说明确实是这个Dart引发的警告。

再次运行flutter doctor -v, 警告消失,搞定!

wangyangyangdeMacBook-Pro:~ wangyang$ flutter doctor -v[✓] Flutter (Channel stable, 3.7.9, on macOS 12.6.5 21G531 darwin-x64, locale    zh-Hans-CN)    • Flutter version 3.7.9 on channel stable at      /Users/wangyang/Developer/develop_env/flutter_3.7.9    • Upstream repository https://github.com/flutter/flutter.git    • Framework revision 62bd79521d (5 weeks ago), 2023-03-30 10:59:36 -0700    • Engine revision ec975089ac    • Dart version 2.19.6    • DevTools version 2.20.1    • Pub download mirror https://pub.flutter-io.cn

来源地址:https://blog.csdn.net/adojayfan/article/details/130499289

--结束END--

本文标题: 消除Flutter doctor的警告Warning: `dart` on your path resolves to xxx/bin/dart

本文链接: https://lsjlt.com/news/376859.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作