Pankaj Bansal
Pankaj Bansal

Reputation: 23

EACCES: permission denied, mkdir '/usr/local/lib/node_modules/react-native-cli'

permission denied issue in mac while installing react-native-cli The operation was rejected by your operating system.It is likely you do not have the permissions to access this file as the current user

npm install -g react-native-cli
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/react-native-cli
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir 
'/usr/local/lib/node_modules/react-native-cli'
npm ERR!  [Error: EACCES: permission denied, mkdir 
'/usr/local/lib/node_modules/react-native-cli'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/react-native-cli'
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.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/intersoft-admin/.npm/_logs/2021-11-10T09_56_34_035Z-debug.log

Upvotes: 2

Views: 9857

Answers (2)

Shivani Choudhary
Shivani Choudhary

Reputation: 11

I solved this by simply running:

sudo npm install -g react-native-cli

and adding in my password.

Upvotes: 1

Pankaj Bansal
Pankaj Bansal

Reputation: 387

try this command sudo npm install -g react-native-cli

Upvotes: 11

Related Questions