折腾开发Mac 更新 node 版本查看当前版本1 2 3 xxdeMacBook-Pro:~ y$ node -v v10.16.3 1 2 3 xxdeMacBook-Pro:~ y$ npm -v 6.9.0 清缓存1 2 3 4 xxdeMacBook-Pro:~ y$ sudo npm cache clean -f Password: npm WARN using --force I sure hope you know what you are doing. 安装 N 模块1 2 3 4 5 xxdeMacBook-Pro:~ y$ sudo npm install -g n /Users/y/npm_installs/bin/n -> /Users/y/npm_installs/lib/node_modules/n/bin/n + n@6.6.0 added 1 package from 4 contributors in 1.251s 安装最新版本的 node1 2 3 4 5 xxdeMacBook-Pro:bin y$ sudo n stable installing : node-v12.18.2 mkdir : /usr/local/n/versions/node/12.18.2 fetch : https://nodejs.org/dist/v12.18.2/node-v12.18.2-darwin-x64.tar.xz stable 稳定版latest 最新版推荐升级稳定版本升级 npm 到最新版1 2 3 sudo npm install npm@latest -g + npm@6.14.6 验证升级版本1 2 3 xxdeMacBook-Pro:~ y$ node -v v12.18.2 1 2 3 xxdeMacBook-Pro:~ y$ npm -v 6.14.5