Mac VSCode /bin/sh: dart: command not found

由于之前安装Flutter时候已经捆绑安装了Dart,所以Dart路径在FlutterSDK的/bin/cache/dart-sdk目录下,我们需要配置Dart的环境变量:
命令打开环境变量:

sudo vi ~/.bash_profile

配置Dart SDK所在路径:

export PATH=${PATH}:flutterSDK地址/bin/cache/dart-sdk

保存并退出,保险起见刷新一下profile

source ~/.bash_profile

检查Dart是否配置正确,终端输入:

dart

出现以下结果就是成功了


image.png

别忘了重启VSCode!!!

你可能感兴趣的:(Mac VSCode /bin/sh: dart: command not found)