苹果笔记本 MacBook Pro
- 芯片:M1
- 操作系统:macOS 15.1.1
使用 nvm 安装 Nodejs(v14)会报错:
nvm install --lts=fermium
Installing with latest version of LTS line: fermium
Downloading and installing node v14.21.3...
Downloading https://nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-arm64.tar.xz...
curl: (56) The requested URL returned error: 404
download from https://nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-arm64.tar.xz failed
grep: /Users/rich1e/.nvm/.cache/bin/node-v14.21.3-darwin-arm64/node-v14.21.3-darwin-arm64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 10 CPU core(s)
Running with 9 threads to speed up the build
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Local cache found: ${NVM_DIR}/.cache/src/node-v14.21.3/node-v14.21.3.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v14.21.3/node-v14.21.3.tar.xz
$>./configure --prefix=/Users/rich1e/.nvm/versions/node/v14.21.3 <
Node.js configure: Found Python 3.14.0...
Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.
nvm: install v14.21.3 failed!
报错原因是 python 版本不支持,
Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.
通过 pyenv 安装支持的版本,例如:python3.10~3.5
安装 python 完成后,再次执行:
nvm install --lts=fermium
如果仍然报错,那么可以通过 Rosetta 2 试试。
安装 Rosetta :
softwareupdate --install-rosetta
I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here: https://www.apple.com/legal/sla/
Type A and press return to agree: A
2025-11-10 14:25:48.307 softwareupdate[47336:2590239] Package Authoring Error: 072-30124: Package reference com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute
Install of Rosetta 2 finished successfully
安装完成后,重新启动 iTerm。
当前我的命令行工具是 iTerm,也可以使用系统自带的 Termial。
然后,右击菜单->显示简介,勾选“使用 Rosetta 打开”。
打开 iTerm,再次执行:
nvm install --lts=fermium
这样应该就成功了~🏅
Ref
- Mac系统如何安装rosetta?-CSDN博客
- 如果您需要在 Mac 上安装 Rosetta - Apple 支持 --- If you need to install Rosetta on Mac - Apple Support
- 使用 pyenv 管理 Python 版本和虚拟环境 - Newverse & Wiki
(77 封私信 / 81 条消息) Python 切换版本及虚拟环境 - 知乎 - MacBookPro M1 升级11.3后没有… - Apple 社区
- Python多环境管理神器(pyenv) - doublexi - 博客园
- M1芯片 mac 环境配置_mac怎么通过rosetta打开terminal-CSDN博客