VS Code已经安装了flutter插件,同时也下载了flutter包,配置了包的环境配置,但是最后还是识别不了flutter的命令,这是什么原因呢? 不知道是否是MAC M1的原因,之前也没遇到过,我找了一些相关的资料得知:
-
Open up Terminal. Run the following command: sudo nano /etc/paths
-
Enter your password, when prompted.
-
Go to the bottom of the file, and enter the path you wish to add. 这里添加的就是你下载的flutter包的bin文件的完整路径。。。 例如:/Users/***/Downloads/flutter/bin
-
Hit control-x to quit.
-
Enter “Y” to save the modified buffer.
以上这些操作完,然后重启VS Code,你会发现此刻flutter命令能够识别了!