node有一个模块叫n(这名字可够短的。。。),是专门用来管理node.js的版本的。 首先安装n模块:
HaleydeMacBook-Pro:myAppTest haley$ npm install -g n
npm http GET https://registry.npmjs.org/n
npm http 200 https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/n/-/n-1.2.13.tgz
npm http 200 https://registry.npmjs.org/n/-/n-1.2.13.tgz
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
n@1.2.13 /usr/local/lib/node_modules/n
升级到最新稳定版本:
HaleydeMacBook-Pro:myAppTest haley$ n stable

     install : v0.10.35
       mkdir : /usr/local/n/versions/0.10.35
       fetch : http://nodejs.org/dist/v0.10.35/node-v0.10.35-darwin-x64.tar.gz
   installed : v0.10.35
HaleydeMacBook-Pro:myAppTest haley$
n后面也可以跟随版本号比如: n v0.10.26