Ugh. I needed to fire up the loan MacBook Air to do an iOS compile of my recently completed Appcelerator app. Naturally, I started off on the wrong foot by not recalling the MacBook’s password (luckily I found that I had mailed it to myself some time ago, so I did eventually get in). Then Appcelerator moaned that it needed an update, which failed because it needed a newer version of Node.js to be installed.

So off to Google I once more marched, the result of which I am now jotting down here as a future reminder: How to Update Node.js on a MacBook Air.

As it turns out, updating node.js is a pretty quick affair: First, fire up a terminal (which again I needed to march over to Google in order to learn how to do), and then run the following commands:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Note the use of sudo to run these commands. Essentially we are first force clearing the npm cache, then installing and upgrading node to the latest version.

Related Link: MacBook Air | Node.js