欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

ENV 5 步安装 npm 和 node(自制精简版)

最编程 2024-09-29 17:31:20
...

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