学习篇 | 5步安装 npm node(homebrew 简洁版)
1. 操作步骤
1.1 安装 homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
1.2 安装 node
# 安装最新版
brew install node
# 安装指定版本,如18
brew install node@18
1.3 安装 nvm(灵活)
brew install nvm
1.4 安装 npm
brew install npm
1.5 通过 npm 安装其他包
npm install -g xxx
2. 参考资料
2.1 Homebrew
https://brew.sh/
2.2 Downloading and installing Node.js and npm
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm