当前位置: 首页 > news >正文

MacOS 配置 Fvm环境

系统环境:MacOS 13,M1芯片

1. 安装HomeBrew:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed

2. 使用brew安装Fvm:

brew tap leoafarias/fvm
brew install fvm

3.配置FVM_HOME:

export FVM_HOME="$HOME/fvm"

4. 安装flutter SDK

查看远程flutter 发布的SDK

fvm releases

报错信息:

Failed to retrieve the Flutter SDK from: https://flutter-io.cn/flutter_infra_release/releases/releases_macos.json
Fvm will use the value set on env FLUTTER_STORAGE_BASE_URL to check versions
if you are located in China, please see this page: https://flutter.dev/community/china

Please run command with  --verbose if you want more information

执行:查看下报错详情

fvm releases  --verbose 

报错详情:

[     0.001s] SocketException: Connection refused (OS Error: Connection refused, errno = 61), address = raw.githubusercontent.com, port = 56560
[     0.117s] HttpException: Not Found

Failed to retrieve the Flutter SDK from: https://flutter-io.cn/flutter_infra_release/releases/releases_macos.json
Fvm will use the value set on env FLUTTER_STORAGE_BASE_URL to check versions
if you are located in China, please see this page: https://flutter.dev/community/china

因为使用国内地址需要执行以下命令:

export PUB_HOSTED_URL=https://pub.flutter-io.cnexport FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

5.安装SDK指定版本:

fvm install 3.7.5

查看已安装的版本信息

fvm list

6.使用fvm配置全局SDK版本

fvm global 3.7.5
export PATH="$HOME/fvm/default/bin:$PATH"

最后让环境变量生效

source ~/.zshrc

7.在VScode中使用Fvm

执行doctor命令

fvm flutter doctor  

版本切换:

//切换到1.22.6
fvm use 1.22.6 --force  
//切换到 3.7.5
fvm use 3.7.5 --force   

8.Fvm常用命令

  • config: 对 fvm 进行配置
  • flutter: 对 Flutter 的命令进行代理
  • install: 安装 Flutter 版本
  • list: 查看已安装的 Flutter 版本
  • releases: 查看 Flutter sdk 都有哪些发布的版本
  • remove:删除已安装的某个 Flutter 的版本
  • use: 选择你要使用的版本
  • version: 查看安装 fvm 的版本

更具资料来源修改

http://www.lryc.cn/news/21083.html

相关文章:

  • Python小白入门- 01( 第一章,第1节) 介绍 Python 编程语言
  • 高并发系统设计之缓存
  • 【N32WB03x SDK使用指南】
  • pytest测试框架——pytest.ini用法
  • KAFKA安装与配置(带Zookeeper)2023版
  • 深入浅出解析ChatGPT引领的科技浪潮【AI行研商业价值分析】
  • .net 批量导出文件,以ZIP压缩方式导出
  • 数据分析:某电商优惠卷数据分析
  • 性能测试流程
  • zookeeper集群的搭建,菜鸟升级大神必看
  • C语言之习题练习集
  • Buuctf [ACTF新生赛2020]Universe_final_answer 题解
  • 【Linux】环境变量
  • 单一职责原则
  • golangの并发编程(GMP模型)
  • MacBook Pro错误zsh: command not found: brew解决方法
  • spring中BeanFactory 和ApplicationContext
  • HC32L17x的LL驱动库之dma
  • SSM项目 替换为 SpringBoot
  • RL笔记:动态规划(2): 策略迭代
  • 2023软件测试金三银四常见的软件测试面试题-【测试理论篇】
  • 蓝桥训练第二周
  • 详讲函数知识
  • gin 框架初始教程文档
  • Maven的下载和安装【详细】
  • [数据结构]:04-循环队列(数组)(C语言实现)
  • buu [GWCTF 2019]BabyRSA 1
  • codeforces 1669F
  • 高数考试必备知识点
  • [蓝桥杯] 二分与前缀和习题练习