自从更新到 11.4 以来,我无法在我的 m1 MacBook 终端上运行简单的进程,所有命令(例如 mkdir, react-native start, ./gradlew assembleRelease
和其他命令)都失败并在控制台中显示此输出:zsh: killed script-name
。
查看崩溃报告,这是我看到的崩溃列表:crash-list
具有相同的终止原因:Namespace CODESIGNING, Code 0x1
这是完整的描述:
Path: /usr/local/bin/mkdir
Identifier: mkdir
Version: ???
Code Type: X86-64 (Translated)
Parent Process: zsh [1730]
Responsible: Terminal [1728]
User ID: 501
Date/Time: 2021-06-27 16:09:13.008 +0200
OS Version: macOS 11.4 (20F71)
Report Version: 12
Anonymous UUID: 5A1B4802-F11F-C934-98E5-7F8599731810
Sleep/Wake UUID: 2AE97327-79A9-4A8F-AF41-E70AD8D06E06
Time Awake Since Boot: 5200 seconds
Time Since Wake: 4900 seconds
System Integrity Protection: enabled
Crashed Thread: Unknown
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x1
kernel messages:
VM Regions Near 0 (cr2):
-->
mapped file 102a4b000-102a4f000 [ 16K] r-x/r-x SM=COW Object_id=3b127209
Backtrace not available
Unknown thread crashed with unknown flavor: 7, state_count: 4
Binary images description not available
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
VM Region Summary:
Writable regions: Total=18.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=18.8M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
STACK GUARD 56.0M 1
Stack 8176K 1
VM_ALLOCATE 10.5M 1
VM_ALLOCATE (reserved) 76K 3 reserved VM address space (unallocated)
mapped file 4.7G 11
=========== ======= =======
TOTAL 4.8G 17
TOTAL, minus reserved VM space 4.8G 17 ```
I have no idea what is the issue, please help.
答案 0 :(得分:0)
我不知道 macOS 11.4 更新有什么变化,但我的一个朋友遇到了和你完全一样的问题。
问题是您在 /usr/local/bin
中安装了一些英特尔二进制文件,这是 $PATH
中的第一个条目。您的 shell 尝试执行该路径中的命令(例如 ls
或 mkdir
或其他任何命令)并失败,因为它们是 Intel 二进制文件,并且您的 shell 或终端均未设置为通过 Rosetta 运行(兼容性用于在 M1 Mac 上运行 Intel 二进制文件的层)。
临时修复是通过在 shell 配置文件中导出一个来更改您的 $PATH
,即 ~/.zshrc
:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
保存该文件并重新启动您的终端。一切都应该重新开始了。