浩晨众云网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
一、安装brew
终端上运行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
二、安装nodejs
运行brew install node 即可,但是这样安装的node是最新node,本人安装后是node6.X,node6.X对一些就模块已经不支持了,比如graceful-fs,导致安装一些包的时候,无法运行,就会出现类似 (node:7844) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version 的提示。
三、安装指定版本的node
旧版的brew,可以通过brew versions nodejs,运行后会提示 Error: The `versions` command is no longer supported. brew versions已废弃掉了。
1、需要安装homebrew-version
brew tap homebrew/versions