Mac安装Dart时,Homebrew报错 Error: Failure while executing

前言:

最近准备开发Flutter项目时,在安装环境时,安装Homebew时遇到了以下报错信息,在这里分享一下。

报错信息:

~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
fatal: unable to access 'https://github.com/dart-lang/homebrew-dart/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
Error: Failure while executing; `git clone https://github.com/dart-lang/homebrew-dart /opt/homebrew/Library/Taps/dart-lang/homebrew-dart --origin=origin --template= --config core.fsmonitor=false` exited with 128.

解决方案:

安装 ARM 版 Homebrew
ARM版Homebrew最终被安装在/opt/homebrew路径下。

直接执行:

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

然后还需设置环境变量,具体操作步骤如下,一定要仔细阅读。

在终端执行命令echo $SHELL获得终端类型:

/bin/zsh => zsh => .zprofile
/bin/bash => bash => .bash_profile

如果看到的是/bin/zsh执行:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)" #brew.idayer.com' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

如果看到的是/bin/bash执行:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)" #brew.idayer.com' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"

从macOS Catalina(10.15.x) 版开始,Mac使用zsh作为默认Shell。

Homebrew 安装成功~

~ % brew -v
Homebrew 4.1.7

然后继续执行

 brew tap dart-lang/dartbrew install dart

提示安装失败

~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...error: RPC failed; curl 35 LibreSSL SSL_read: Operation timed out, errno 60
fatal: expected flush after ref listing
Error: Failure while executing; `git clone https://github.com/dart-lang/homebrew-dart /opt/homebrew/Library/Taps/dart-lang/homebrew-dart --origin=origin --template= --config core.fsmonitor=false` exited with 128.

再次执行效果:

~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
remote: Enumerating objects: 3684, done.
remote: Counting objects: 100% (1438/1438), done.
remote: Compressing objects: 100% (437/437), done.
remote: Total 3684 (delta 1185), reused 1199 (delta 995), pack-reused 2246
Receiving objects: 100% (3684/3684), 671.61 KiB | 54.00 KiB/s, done.
Resolving deltas: 100% (2461/2461), done.
Tapped 22 formulae (53 files, 857.5KB).

安装成功啦!!!!

然后安装

~ % brew install dart
==> Fetching dart-lang/dart/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.
############################################                                       54.8%curl: (56) LibreSSL SSL_read: Connection reset by peer, errno 54Error: dart: Failed to download resource "dart"
Download failed: https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.0/sdk/dartsdk-macos-arm64-release.zip

又出现报错信息了

那我们再次尝试一下呢

这次就很快安装成功了

brew install dart
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api/formula.jws.js
##O#- #                                                                                
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api/cask.jws.json
##O#- #                                                                                
==> Fetching dart-lang/dart/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.
################################################################################# 100.0%
==> Installing dart from dart-lang/dart
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences.If that doesn't show you any updates, run:sudo rm -rf /Library/Developer/CommandLineToolssudo xcode-select --installAlternatively, manually download them from:https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 14.2.==> Caveats
Please note the path to the Dart SDK:/opt/homebrew/opt/dart/libexec
==> Summary
🍺  /opt/homebrew/Cellar/dart/3.1.0: 987 files, 554.3MB, built in 6 seconds
==> Running `brew cleanup dart`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

安装环境的时候和网络也有一定的关系,我们可以多试两次

我们我们测试一下安装成功没

~ % dart --version
Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "macos_arm64"

👌👌👌

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/61758.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java-集合框架-List,Set,Map,队列

文章目录 Java集合框架:List,Set,Map,队列Java集合框架是什么?如何使用?ListSetMap队列 什么场景使用?优缺点是什么?ListSetMap队列 Java示例List示例Set示例Map示例队列示例 对比 J…

BMC相关知识

简介 BMC(Baseboard Management Controller),基板管理控制器,普通PC没有,服务器产品必备。BMC是一个独立的系统,只要通电即可运行,服务器无需开机,不依赖其它软硬件,如O…

Unity音频基础概念

一、音源与音频侦听器 游戏画面能够被观众看到,是因为有渲染器和摄像机,同样音频能够被听到,也要有声音的发出者与声音的接收者。声音的发出者叫做音源,接收者叫做音频侦听器。Audio Source与Audio Listener都是组件,…

webrtc 的Bundle group 和RTCP-MUX

1,最近调试程序的时候发现抱一个错误 max-bundle configured but session description has no BUNDLE group 最后发现是一个参数设置错误 config.bundle_policy webrtc::PeerConnectionInterface::BundlePolicy::kBundlePolicyMaxBundle; 2,rtcp-mu…

Linux之Shell(一)

Linux之Shell Shell概述Linux提供的Shell解析器bash和sh的关系Centos默认的解析器是bash Shell脚本入门脚本格式第一个脚本脚本常用的执行方式 变量系统预定义变量自定义变量特殊变量$n$#\$*、\$$? 运算符条件判断流程控制(▲)if判断case语句for循环while循环 read读取控制台输…

macos安装zsh

https://www.cnblogs.com/xuLessReigns/p/11005435.html mac下安装autojump brew install autojump 1,安装zsh,执行 sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 2,将zsh设置…

并发容器11

一 JDK 提供的并发容器总结 JDK 提供的这些容器大部分在 java.util.concurrent 包中。 ConcurrentHashMap: 线程安全的 HashMap CopyOnWriteArrayList: 线程安全的 List,在读多写少的场合性能非常好,远远好于 Vector. ConcurrentLinkedQueue: 高效的并…

设计模式入门笔记

1 设计模式简介 在IT这个行业,技术日新月异,可能你今年刚弄懂一个编程框架,明年它就不流行了。 然而即使在易变的IT世界也有很多几乎不变的知识,他们晦涩而重要,默默的将程序员划分为卓越与平庸两类。比如说&#xff…

unity 之参数类型之引用类型

文章目录 引用类型引用类型与值类型的差异 引用类型 在Unity中,引用类型是指那些在内存中存储对象引用的数据类型。以下是在Unity中常见的引用类型的介绍: 节点(GameObject): 在Unity中,游戏对象&#xff…

无重叠区间【贪心算法】

无重叠区间 给定一个区间的集合 intervals ,其中 intervals[i] [starti, endi] 。返回 需要移除区间的最小数量,使剩余区间互不重叠 。 class Solution {public int eraseOverlapIntervals(int[][] intervals) {//先排序,按照左边界升序,注…

【爬虫】实验项目一:文本反爬网站的分析和爬取

目录 一、实验目的 二、实验预习提示 ​编辑 三、实验内容 四、实验要求 五、实验过程 1. 基本要求: 2. 改进要求A 3. 改进要求B: 六、资料 1.实验框架代码: 2.OpenSSL:Win32/Win64 OpenSSL Installer for Windows - Shining Light…

Node与Express后端架构:高性能的Web应用服务

在现代Web应用开发中,后端架构的性能和可扩展性至关重要。Node.js作为一个基于事件驱动、非阻塞I/O的平台,以及Express作为一个流行的Node.js框架,共同构建了高性能的Web应用服务。 在本文中,我们将深入探讨Node与Express后端架构…

Windows笔记本电脑开机黑屏

Windows笔记本电脑开机黑屏 最近,我遇到了一件奇怪的事情。我的Windows笔记本电脑在开机时出现了一个黑屏,没有任何反应。我尝试了多种方法,包括重启和恢复出厂设置,但都无济于事。 我开始感到担心,因为这只会影响到…

污水厂数字孪生 | 3D可视化管理系统助力污水企业数字化管理

随着城市化进程的不断加快,污水处理成为了城市环境保护的重要组成部分。传统的污水处理方式往往存在诸多问题,如信息不对称、安全隐患等。为了解决这些问题,污水处理3D可视化管控平台应运而生,它通过结合数字孪生技术和远程指导技…

【行为树】py_trees 学习笔记

学习资料 《Introduction to behavior trees》 1. 概念说明 1.1 Action:pt.behaviour.Behaviour 在一个行为树中,Action 是一个叶节点(Leaf Node),它实际执行某种行为或任务,并返回成功、失败或运行中的…

Unity关键概念

Unity是一款跨平台的游戏引擎和开发工具,用于创建2D和3D游戏、交互式内容和应用程序。它提供了一个强大的开发环境,使开发者能够轻松地设计、开发和部署高质量的游戏和应用程序。 以下是Unity的几个关键概念: 游戏对象(Game Obj…

【逻辑运算符】在Java中 和的区别 ||和|的区别

&&和&都表示与运算符,结果为有假则假,&&为短路与运算符,如果表达式A的值为假,则表达式B不执行;&表示逻辑与运算符,表达式A和表达式B都会执行 ||和|都表示或运算符,结果为有真则真&…

C# 静态构造函数未执行 .net core框架

代码如下&#xff0c;在执行Encoding.GetEncoding(“gb2312”);方法后报错&#xff0c;说没有找到对应编码&#xff0c;经测试&#xff0c;发现是静态构造函数未执行。 public static class Encodings {/// <summary>/// 注册相关编码/// </summary>static Encodi…

SpringBoot整合Freemaker结合Vue实现页面填写一键自动生成Redis的配置文件

&#x1f9d1;‍&#x1f4bb;作者名称&#xff1a;DaenCode &#x1f3a4;作者简介&#xff1a;啥技术都喜欢捣鼓捣鼓&#xff0c;喜欢分享技术、经验、生活。 &#x1f60e;人生感悟&#xff1a;尝尽人生百味&#xff0c;方知世间冷暖。 &#x1f4d6;所属专栏&#xff1a;Sp…

【Android】使用 adb 命令行工具结合 pm列出 Android 设备上已安装应用的应用名称和包名

要列出 Android 设备上已安装应用的应用名称和包名&#xff0c;你可以使用 adb 命令行工具结合 pm&#xff08;PackageManager&#xff09;命令来实现。 首先&#xff0c;确保你已经安装了 Android SDK&#xff0c;并将 adb 工具添加到系统的环境变量中。 然后&#xff0c;打…