Could not find a Flutter SDK. Please ensure flutter is installed and in your PAT

451 阅读1分钟

VS Code已经安装了flutter插件,同时也下载了flutter包,配置了包的环境配置,但是最后还是识别不了flutter的命令,这是什么原因呢? 不知道是否是MAC M1的原因,之前也没遇到过,我找了一些相关的资料得知:

  1. Open up Terminal. Run the following command: sudo nano /etc/paths

  2. Enter your password, when prompted.

  3. Go to the bottom of the file, and enter the path you wish to add. 这里添加的就是你下载的flutter包的bin文件的完整路径。。。 例如:/Users/***/Downloads/flutter/bin

  4. Hit control-x to quit.

  5. Enter “Y” to save the modified buffer.

以上这些操作完,然后重启VS Code,你会发现此刻flutter命令能够识别了!