Flutter get_cli的使用

win安装get_cli

pub global activate get_cli
flutter pub global activate get_cli

提示

Warning: Pub installs executables into F:\flutter_windows\flutter_windows_3.3.0-
stable\flutter\.pub-cache\bin, which is not on your path.

下面路径添加到Path环境变量里面

F:\flutter_windows\flutter_windows_3.3.0-stable\flutter\.pub-cache\bin
F:\flutter_windows\flutter_windows_3.0.5\flutter\bin\cache\dart-sdk\bin

win

mac安装get_cli

pub global activate get_cli
flutter pub global activate get_cli

配置环境变量

Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on
your path.

一般Mac 的环境变量都是通过根目录的.bash_profile 进行环境变量设置。

vim ~/.bash_profile
vim ~/.zshrc
export PATH=/Users/aishengwanwu/flutter_mac/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
....
export PATH="$PATH":"$HOME/.pub-cache/bin"
export PATH=/Users/aishengwanwu/flutter_mac/flutter/bin\cache\dart-sdk\bin:$PATH

让配置环境变量生效

source ~/.bash_profile
source ~/.zshrc

不管是执行fvm list 还是 fvm --version ,都报错:

Can't load Kernel binary: Invalid SDK hash.

最后的解决方案是执行:

dart pub global activate fvm

results matching ""

    No results matching ""