错误 CPU 可执行文件类型 mac Intel 核心

Bad CPU type in executable mac Intel core

正在尝试安装特定版本的 nvm

但是我明白了

nvm install 16.14.2
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
-bash: /opt/homebrew/bin/awk: Bad CPU type in executable
A version number is required.

我的 mac 有 2.4 GHz 8-Core Intel Core i9

file /opt/homebrew/bin/awk
/opt/homebrew/bin/awk: Mach-O 64-bit executable arm64

uname -a
Darwin <mystuff> 21.4.0 Darwin Kernel Version 21.4.0: <timestamp>; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64

不知道该怎么做才能让它发挥作用。有什么建议吗?

发现我的 ARM 默认前缀是错误的:- /usr/local on macOS intel - /opt/homebrew on macOS ARM - /home/linuxbrew on Linux ----- - 为了修复它,我不得不卸载 Homebrew,在此处找到:github.com/homebrew/install#uninstall-homebrew 然后我不得不重新安装它,在相同的 link 找到。重新安装它将默认前缀从不正确的 /opt/homebrew 更改为正确的 /usr/local 前缀