0

For some reason, the system's looking for something called react-is, leading to this error:

Failed to compile.

./node_modules/prop-types/node_modules/react-is/index.js
Error: ENOENT: no such file or directory, open 'C:\Users\mikwee\linkroots\node_modules\prop-types\node_modules\react-is\index.js'

It is a package, but it's looking for it inside prop-types for some reason. This error started when I imported a React Bootstrap component. I'm not sure what other info to add here, so if you need to know more, let me know please!

mikwee
  • 133
  • 2
  • 14
  • try an `npm i` to install all dependencies – RobCo Nov 05 '21 at 12:22
  • 1
    1. I'm actually on Yarn, so I just used `yarn`. 2. It says everything's already up-to-date. – mikwee Nov 05 '21 at 12:28
  • react-is is a dependency of prop-types, which is a dependency of react-bootstrap (and many others). When you `rm -rf node_modules/` and then `yarn`, do you still have the issue? – Jake Worth Nov 05 '21 at 12:39
  • 1
    How do you do that on PowerShell? – mikwee Nov 05 '21 at 12:42
  • PowerShell `rm -r -fo node_modules` ([source](https://stackoverflow.com/a/1752751/6151924)) – RobCo Nov 05 '21 at 12:46
  • 1
    OK, so I did `rm -r -fo node_modules/`, because that's what an answer on this site told me to do. Got tons of errors saying it can't delete directory X because it's not empty. Then did `yarn`, and still got the error. – mikwee Nov 05 '21 at 12:57
  • You have to delete that directory-- however that's done in your terminal. The `yarn` command in the answer you found is premised on deleting that directory. – Jake Worth Nov 05 '21 at 14:54
  • 1
    I don't know how, but the problem just got fixed by itself. I guess there's no need for that! – mikwee Nov 05 '21 at 14:56

2 Answers2

1

Just delete the node_modules folder in your explorer and run yarn again.

If it still fails you can install react-is explicitly using

yarn add react-is

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 05 '21 at 15:01
-1

try an npm i react-is@latest only for yarn

Fabian S.
  • 2,441
  • 2
  • 24
  • 34