Node upgrade installation plug-in error

  node.js, question

In mac environment, I upgraded the version of node from 0.12 to 5.0, and then installed gulp-sass, reporting an error.

npm ERR!  Darwin 15.0.0
 npm ERR!  argv "/usr/local/Cellar/node/0.12.2_1/bin/node" "/usr/local/bin/npm" "install" "gulp-sass"
 npm ERR!  node v5.0.0
 npm ERR!  npm  v3.3.6
 
 npm ERR!  Cannot read property 'localeCompare' of undefined
 npm ERR!
 npm ERR!  If you need help, you may report this error at:
 npm ERR!  <https://github.com/npm/npm/issues >
 
 npm ERR!  Please include the following file with any support request:
 npm ERR!  /Users/LiaoYingRay/Projects/coding/rayliao/npm-debug.log

It seems that node’s path problem is still on the path of version 0.12? Does anyone know how to solve it?


The issue of npm said it was a version problem of npm, so I tried to install and upgrade NPM: NPInstallGNPM @ latest
But there was still a mistake.

pm@3.3.10
 
 npm ERR!  Darwin 15.0.0
 npm ERR!  argv "/usr/local/Cellar/node/0.12.2_1/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@latest"
 npm ERR!  node v5.0.0
 npm ERR!  npm  v3.3.6
 npm ERR!  path /usr/local/lib/node_modules/npm/node_modules/ansi-styles
 npm ERR!  code EACCES
 npm ERR!  errno -13
 npm ERR!  syscall access
 
 npm ERR!  Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/ansi-styles'
 npm ERR!  at Error (native)
 npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/ansi-styles']
 npm ERR!  errno: -13,
 npm ERR!  code: 'EACCES',
 npm ERR!  syscall: 'access',
 npm ERR!  path: '/usr/local/lib/node_modules/npm/node_modules/ansi-styles' }
 npm ERR!
 npm ERR!  Please try running this command again as root/Administrator

I will be fine if I change the version of node back to 4.2.1!
However, I am a little concerned about why I upgraded node, but the local node directory is still only 0.12?

usr/local/Cellar/node/0.12.2_1
usr/local/Cellar/node/0.12.2_1

Node in this directory is installed by homebrew, and only brew uninstall node is required.