p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px "PingFang SC Semibold"; color: #2c3033 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px "PingFang SC"; color: #bbbbbb }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px "PingFang SC"; color: #4f4f4f }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; text-align: justify; font: 16.0px "PingFang SC"; color: #4f4f4f }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px "PingFang SC"; color: #4f4f4f; min-height: 22.0px }
p.p7 { margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px "PingFang SC"; color: #4f4f4f; background-color: #ffffff }
li.li3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px "Helvetica Neue"; color: #bbbbbb }
span.s1 { font: 24.0px "PingFang SC"; background-color: #ffffff }
span.s2 { color: #78909c; background-color: #ffffff }
span.s3 { background-color: #ffffff }
span.s4 { background-color: #ffffff }
span.s5 { }
ul.ul1 { list-style-type: none }
ps:copy 别人的,仅仅是存档
- 31594
一、安装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
1、需要安装homebrew-version 安装nvm
brew install nvm
2、查看可安装的node版本
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 }
span.s1 { font: 12.0px ".PingFang SC" }
source $(brew --prefix nvm)/nvm.sh 唤醒nvm
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 }
span.s1 { font: 12.0px ".PingFang SC" }
span.Apple-tab-span { white-space: pre }
nvm ls-remote 查看所有node 版本
nvm install version 就可以安装你想要的版本
3、切换node的版本
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #454545 }
nvm use --delete-prefix version