在Mac中安装node、npm

在Mac中安装node、npm


[TOC]

1.确认电脑安装了Homebrew


如果已经安装了跳过这一步

如果没有安装在终端输入:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
​


安装成功会看到:Installation successfull!

此时可以进行测试是否安装成功

终端输入:

brew



看到如下提示说明安装成功

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
​

2.安装node与npm

​
brew install node
​

//查看node版本
node -v
//查看npm版本
npm -v
​

你可能感兴趣的:(在Mac中安装node、npm)