我在mac中安装Apache cordova时终端中有很多npm错误。我也尝试了sudo npm install -g cordova,但它是相同的并且在使用Cordova时没有安装Cordova --version
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! path /Users/macmini/.node/bin/cordova
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall unlink
npm ERR! Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'unlink',
npm ERR! path: '/Users/macmini/.node/bin/cordova' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES: permission denied, unlink '/Users/macmini/.node/bin/cordova']
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: '/Users/macmini/.node/bin/cordova' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/macmini/npm-debug.log