Npm install -g cordova ionic Error

#1

iMac:~ isathish$ npm install -g cordova ionic
npm ERR! Darwin 14.3.0
npm ERR! argv “node” “/usr/local/bin/npm” “install” “-g” “cordova” “ionic”
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! path /usr/local/lib/node_modules/cordova
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir ‘/usr/local/lib/node_modules/cordova’
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, rmdir ‘/usr/local/lib/node_modules/cordova’]
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! path: ‘/usr/local/lib/node_modules/cordova’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir ‘/usr/local/lib/node_modules/cordova’
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, rmdir ‘/usr/local/lib/node_modules/cordova’]
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: ‘EACCES’,
npm ERR! error rolling back path: ‘/usr/local/lib/node_modules/cordova’ }

npm ERR! Please include the following file with any support request:
npm ERR! /Users/isathish/npm-debug.log

1 Like
#2

It’s a permissions error. You need to prepend the command with sudo, or change ownership of the /usr/local/lib/node_modules/cordova directory (and any other directories that give EACCES errors).

For example:

sudo chown -R isathish /usr/local/lib/node_modules/cordova/

See these posts for more help:

#3

Thanks problem solved

#4

Thanks …brandysea. :smile:

1 Like
#5

I wear windows, i’m wrong.
Would you help me?