4

I am trying to install and run react-devtools. I am following this guide to do that: https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md

The install seems to go ok:

enter image description here

To verify it installed correctly I do this command:

enter image description here

And I go to that directory and verify there is a folder called react-devtools.

To open the tools the docs indicate I should do this:

enter image description here

Back in my project directory I run this command:

enter image description here

And it says command not found. So it looks like I have installed the devtools, but I am unable to open them. What am I doing wrong?

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Lizza
  • 2,769
  • 5
  • 39
  • 72

5 Answers5

13

Maybe this is what you want

Fix not run react-devtools

Option 1:

npm uninstall -g react-devtools
npm uninstall -g electron
npm install -g --verbose react-devtools

Option 2: (Fix in Linux, MacOSX)

sudo npm install -g react-devtools --unsafe-perm=true

Refer: react-devtools-command-not-found

Jundat95
  • 175
  • 2
  • 7
4

if you want to run project level only do the following steps

  1. Install using yarn add --dev react-devtools
  2. Run yarn run react-devtools
Damith Asanka
  • 934
  • 10
  • 12
2

To run react-devtools you can run either of the following commands depending on your package manager.

If using yarn: yarn run react-devtools

If using npm: npm run react-devtools

Moj
  • 2,872
  • 1
  • 13
  • 9
bpeter340
  • 103
  • 1
  • 8
0

The real problem here is you are not giving "super user" permissions for the node package manager for installing the "react-devtools" globally.

Try this command it will fix your problem

sudo npm install -g react-devtools

When ignore the -g parameter in the command npm will install the react-devtools in directory that you currently working in. In your case the home directory.

Matheswaaran
  • 145
  • 2
  • 11
0

I've run into same problem. So here how it actually worked for me.

 npm uninstall react-devtools
 npx react-devtools
Kotana Sai
  • 1,207
  • 3
  • 9
  • 20
VLSLV
  • 1
  • 1