在Mac中安装node、npm
# 在Mac中安装node、npm
[TOC]
# 1.确认电脑安装了Homebrew
如果已经安装了跳过这一步 如果没有安装在终端输入:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
1
2
2
安装成功会看到:Installation successfull! 此时可以进行测试是否安装成功 终端输入:
brew
1
看到如下提示说明安装成功
Example usage:
brew search [TEXT|/REGEX/]
brew info [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA
Contributing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 2.安装node与npm
brew install node
1
2
3
2
3
//查看node版本
node -v
//查看npm版本
npm -v
1
2
3
4
5
2
3
4
5
上次更新: 10/21/2021, 1:52:09 PM