sudo npm [...] in a lot of tips and gists (including some of mine :-P). While this can arguably be ok on a development machine, it's not a very smart thing to do, since npm packages can run arbitrary scripts and commands, which is unsafe, to say the least.
But, for some reason, the official Node.js installation package for OS X won't automatically adjust the necessary folder permissions for you...
If you already used the official installer, there's an easy way to repair it:
sudo chown -R $USER /usr/local
If you're installing Node.js with homebrew (
brew install nodejs), everything should be set up properly.