MAC下安装npm和node

Step1: 在官网下载适合mac的版本的nodejs,官网地址https://nodejs.org/en/

Step2: 上述方法我试了,但是不管用。安装完毕且重启均不能显示我安装的版本。哭

下面重新介绍一个方法

Step1: 首先安装brew,brew是一款常用的 MacOS 的包管理器,官网http://brew.sh/index_zh-cn.html

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

Step 2: brew install node

Step 3: 验证是否安装成功

node -v:查看node版本

npm -v:查看npm版本

 

猜你喜欢

转载自www.cnblogs.com/qianjinyan/p/9074489.html