比如我司用的版本是node 14.17.6
为了减少开发环境搭配时间花费,要装和他这个一样的版本
nvm安装可以,但是有点麻烦
最简单方法是通过n来安装
不需要配置环境变量
(base) lizihao@lizihaodeMacBook-Pro ~ % brew install n
==> Downloading https://ghcr.io/v2/homebrew/core/n/manifests/8.0.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/n/blobs/sha256:43dbc0e42d23a9c3
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Pouring n--8.0.0.big_sur.bottle.tar.gz
(base) lizihao@lizihaodeMacBook-Pro ~ % sudo n 14.17.6
installing : node-v14.17.6
mkdir : /usr/local/n/versions/node/14.17.6
fetch : https://nodejs.org/dist/v14.17.6/node-v14.17.6-darwin-x64.tar.xz
installed : v14.17.6 (with npm 6.14.15)