mac下安装node环境

mac下安装node环境
1、在终端输入
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装包管理平台Homebrew
2、输入brew来验证是否安装成功
3、安装成功后,使用
brew install node
命令来安装node
4、使用 node -v 和npm -v 来验证node是否安装成功

更换npm的源地址
npm config set registry https://registry.npm.taobao.org
配置后可通过下面方式来验证是否成功
npm config get registry
使用cnpm替代默认的npm
npm install -g cnpm --registry=https://registry.npm.taobao.org

你可能感兴趣的:(mac下安装node环境)