Reputation: 3719
Trying to install NativeScript on MAC machine, ran following command:
npm install -g nativescript
Installation fails with following error:
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.3677839881'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-debug.log.3677839881']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3677839881' }
Would appreciate help to resolve it.
Upvotes: 1
Views: 575
Reputation: 9229
This is usually a permission error, have you tried sudo npm install -g nativescript
and entering your password? This will give the command root user (admin) privileges, as these are required to install global npm modules by default.
There is another approach, which is to change the global npm folder so it doesn't require elevated privileges:
sudo chown -R $USER /usr/local
Upvotes: 2