Apple Silicon M1用Yarn安装Cypress.io启动失败如何解决
M1芯片Mac运行Cypress 8.3.1启动失败解决方案
你遇到的报错是Cypress 8.x版本未原生适配Apple Silicon架构,Rosetta转译时签名校验失败导致的,可通过以下任意一种方法解决:
- 方法一:单次运行时指定x86架构执行命令
无需修改终端配置,直接在项目目录下执行如下命令即可正常启动Cypress:arch -x86_64 yarn run cypress open
若需要执行其他Cypress命令,只需替换末尾的open参数即可。 - 方法二:配置终端默认使用Rosetta转译运行
- 打开访达的「应用程序」文件夹,找到你常用的终端应用(自带终端、iTerm2等)
- 右键点击应用图标,选择「显示简介」
- 勾选「使用Rosetta打开」选项后重启终端
- 回到项目目录直接执行
yarn run cypress open即可正常运行
- 方法三:升级Cypress到原生支持Apple Silicon的版本
Cypress v10.0及以上版本已经完成Apple Silicon原生适配,无需依赖Rosetta转译即可直接运行,也可正常兼容Laravel框架。可执行如下命令升级到最新稳定版:yarn add cypress@latest --dev
升级完成后直接执行原有启动命令即可正常使用。
附报错原文:
Cypress failed to start. This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies Please refer to the error below for more details. ---------- rosetta error: /var/db/oah/c642c6...79172/Cypress.aot: attachment of code signature supplement failed: 1 ---------- Platform: darwin (20.5.0) Cypress Version: 8.3.1
内容的提问来源于stack exchange,提问作者user3245716
相关产品推荐
相关产品推荐

