Aavi Iskar
Aavi Iskar

Reputation: 21

my npm install -g react-native-cli is not working

it says permission required and I am unable to get the permission for this. due to this problem, I couldn't run react-native on my mac.

I​ tried to get the permissions but couldn't.

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! path /usr/local/lib/node_modules

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 ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']

npm ERR!   stack:

npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

npm ERR!   path: '/usr/local/lib/node_modules' }

npm ERR! 

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR! 

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/aaviskarpokhrel/.npm/_logs/2019-07-21T04_35_00_756Z-debug.log

Upvotes: 2

Views: 1755

Answers (1)

Tien Duong
Tien Duong

Reputation: 2595

You need to use sudo command to install a module globally.

sudo npm install -g react-native-cli

Upvotes: 6

Related Questions