VSCode 找不到 Flutter SDK 的路径 [英] VSCode Can't Find the PATH To the Flutter SDK

查看:41
本文介绍了VSCode 找不到 Flutter SDK 的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚尝试执行 Flutter:New Project,但显示错误找不到 Flutter SDK.我已确保完成 flutter doctor 的所有要求.

I just tried to execute Flutter:New Project, but it shows error could not find a flutter SDK. I've ensure to complete all of requirements from flutter doctor.

有什么办法可以解决这个问题吗?

Is there any way to solve this problem ?

谢谢.

推荐答案

ma​​cOS 上,此问题已通过以下步骤解决.

On macOS this was solved by following these steps.

首先找到你下载flutter sdk的地方(可以从这里下载).除非您选择其他地方,否则它应该在您的下载文件夹中.

First find where you downloaded the flutter sdk (Can be downloaded from here). It should be in your downloads folder unless you selected somewhere else.

下一步:

  1. 打开终端.运行以下命令:sudo nano/etc/paths
  2. 在提示时输入您的密码.
  3. 转到文件底部,然后输入要添加的路径.
  4. 点击 control-x 退出.
  5. 输入Y"保存修改后的缓冲区.

如果 sdk 下载到您的下载文件夹中,您要添加的路径应该是/Users/yourusername/Downloads/flutter/bin

If the sdk is downloaded into your Downloads folder, your path to add should be /Users/yourusername/Downloads/flutter/bin

最后,退出并重新启动终端窗口和 VS Code.重新启动后,两个应用程序都应该可以识别 flutter,并且现在运行 flutter doctor 应该可以工作了.

Lastly, quit and restart your terminal windows and VS Code. After restarting, both apps should recognize flutter and running flutter doctor should now work.

这篇关于VSCode 找不到 Flutter SDK 的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆