5

I am trying to build a react native app. I have caught an error on the terminal saying

Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js"

I reinstalled react-native-reanimated to the expected version range.

`Some of your project's dependencies are not compatible with currently installed expo package version:

  • react-native-reanimated - expected version range: ~1.9.0 - actual version installed: ^1.10.1 Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo install [package-name ...]`

Thus, I run the code as follow: npm install react-native-reanimated@1.9.0, but still run into the error code.

I could realy use some help on this.

Tiago
  • 121
  • 2
  • 9

2 Answers2

7

try uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c"

D10S
  • 1,468
  • 2
  • 7
  • 13
  • I already did that... I even removed react-native-reanimated completly and reinstalled the 1.9.0 version – Tiago Aug 02 '20 at 12:30
  • try: uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c" – D10S Aug 02 '20 at 12:39
  • It worked, thank you very mutch! What is the difference between "expo start -c" and simply "expo start" on the cmd? – Tiago Aug 02 '20 at 12:59
  • Works like a charm! Tnx. – Denis Kulagin Aug 07 '20 at 20:18
  • I tried uninstalling and reinstalling, clearing cache, deleting node-mod's/package-lock etc - even stepped it back to version `react-native-reanimated: 1.7.0` - still no luck. I am being advised this file is missing: `node_modules/react-native-reanimated/src/Animated.js` - checked node modules after each install and it's not there. Weird. – David Pears Aug 10 '20 at 17:52
  • After uninstalling the package and before closing ide's try the 'npm prune' command – D10S Aug 10 '20 at 19:20
4

Only do this:

expo start --clear

From Expo Documentation at Expo Start command.

--clear, -c | Clear the React Native Packager cache.

ATQSHL
  • 381
  • 3
  • 12
  • This command was sufficient for the same issue I have as the OP. Perhaps @ATQSHL can update this answer with the reason why `--clear` flag solves the problem or what that flag does? – Oluwatobi Samuel Omisakin Oct 13 '20 at 07:54