sudo: npm: command not found

I’m trying to upgrade to the latest version of node. I’m following the instructions at http://davidwalsh.name/upgrade-nodejs But when I do: sudo npm install -g n I get the error: sudo: npm: …