My npm is out of date and I can't update it. How can I fix this?
<p>I have had node and npm on my system for a while, but I haven't used them in a while and they seem to be broken.</p>

<p>Today I would like to get back to it and while trying to install yeoman, I got a message that "Your npm version is outdated." and advice to run <code>npm install -g npm</code>.</p>

<p>So I did that and got a lot more errors:</p>

<pre><code>npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! path /usr/local/lib/node_modules/npm/.mailmap
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink

npm ERR! Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.mailmap'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.mailmap']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'unlink',
npm ERR!   path: '/usr/local/lib/node_modules/npm/.mailmap' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.npmignore'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES: permission denied, unlink '/usr/local/lib/node_modules/npm/.npmignore']
npm ERR! error rolling back   errno: -13,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   syscall: 'unlink',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/npm/.npmignore' }

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Dan/npm-debug.log
</code></pre>

<p>I then tried this too</p>

<pre><code>// ♥ unlink '/usr/local/lib/node_modules/npm/.mailmap'
unlink: /usr/local/lib/node_modules/npm/.mailmap: Permission denied
</code></pre>

<p>Honestly, I can't remember whether I installed node with Homebrew or what else is on this thing. I think at some point I installed a node version manager but I could be wrong. Also, I always get nervous following instructions that say to use sudo. I can never remember which instructions to use sudo I'm supposed to not follow.</p>

<p>Any ideas?</p>