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

daolsyd0  于 2023-06-05  发布在  Node.js
关注(0)|答案(2)|浏览(233)

permission denied issue in mac while installing react-native-cli该操作被您的操作系统拒绝。很可能您没有权限以当前用户的身份访问此文件

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
pdkcd3nj

pdkcd3nj1#

试试这个命令sudo npm install -g react-native-cli

j1dl9f46

j1dl9f462#

我通过简单地运行来解决这个问题:

sudo npm install -g react-native-cli

然后输入我的密码

相关问题