Linux, Mac OS X, Solaris, etc.
Unix is easy. Just run the following command. Use sudo if necessary.
$ [sudo] npm explore npm -g -- npm install node-gyp@latest
From: http://lovewindy.com/node-updating-npms-bundled-node-gyp/