方法一

方法二

方法三:nvm (Node Version Manager) 来管理 Node.js

GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh> | bash

source ~/.zshrc

nvm --version
nvm ls-remote

nvm install 22.20.0

nvm which 12.22

nvm ls