mac更新node

今天在用 yeoman 的时候,提示对 npm 和 node 的版本有要求,为了决绝以后遇到的一些类似的问题,我决定定期对 node 和 npm 进行更新。

npm的更新:

$ sudo npm install -g npm

  

node的更新:

# 清除 npm 缓存
$ sudo npm cache clean -f
# 安装 n 小工具 $ sudo npm install -g n
# 安装 Nodejs 最新的稳定版本 $ sudo n stable

我们也可以用 n 小工具安装,node最新官方版(非稳定版本)

$ sudo n latest

  

产考文档:

http://theholmesoffice.com/node-js-fundamentals-how-to-upgrade-the-node-js-version/ 

http://stackoverflow.com/questions/6237295/how-can-i-update-node-js-and-npm-to-the-next-versions

posted @ 2015-04-11 17:37  破男孩  阅读(1142)  评论(0编辑  收藏  举报