I am trying to install react-devtools with this code
sudo npm install -g react-devtools
after running this command, I am getting this error.
/usr/local/bin/react-devtools -> /usr/local/lib/node_modules/react-devtools/bin.js
> [email protected] postinstall /usr/local/lib/node_modules/react-devtools/node_modules/electron
> node install.js
/usr/local/lib/node_modules/react-devtools/node_modules/electron/install.js:47
throw err
^
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/react-devtools/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jayakrishnan/.npm/_logs/2017-08-07T11_22_05_742Z-debug.log
How can I correct this? I am desperately in need of devtools for debugging. If possible, please suggest better debugging tools for React Native.
Based on this issue try the following command to fix this issue:
sudo npm install -g react-devtools --unsafe-perm=true
allow-root
option doe's not solving this issue.
I solved this issue by using yarn.
brew install yarn
yarn global add react-devtools
You don't need to change permissions this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With