一,用brew安装node
liuhongdi@liuhongdideMacBook-Pro Homebrew % brew install node@18 ==> Downloading https://formulae.brew.sh/api/formula.jws.json #=#=# ==> Fetching node@18 ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/node%4018-18.15.0.monterey.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring [email protected] ==> Caveats node@18 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. If you need to have node@18 first in your PATH, run: echo 'export PATH="/usr/local/opt/node@18/bin:$PATH"' >> ~/.zshrc For compilers to find node@18 you may need to set: export LDFLAGS="-L/usr/local/opt/node@18/lib" export CPPFLAGS="-I/usr/local/opt/node@18/include" ==> Summary 标签:node,10,liuhongdi,18,local,npm,usr,安装 From: https://www.cnblogs.com/architectforest/p/17278487.html