seven
seven

Reputation: 1634

Expo app throwing errors when trying to install react-native-maps-directions after full reinstall

I entered Debug Remote JS mode and this caused some errors with react-native-reanimated package, I found here https://github.com/gorhom/react-native-bottom-sheet/issues/771#issuecomment-1048324630 that if I upgrade to the version 2.4.1 it would work, and so I did and it worked but I got a warning from expo that this version is incompatible and my app may not work as expected. So I Removed node_modules and renamed it in package.json from 2.4.1 back to 2.3.1.

At first I had lots of trouble installig it again as "expo install" was throwing errors from app.config.ts because I had used dotenv there and I was unable to install it for some reason. At first npm install failed as well but after second time it kind of installed all the packages, but I am still getting errors from simulator. When I open app on a device it seems to be ok, but the simulator instantly throws

Unable to resolve module ./interpolateColor from /Users/seven/Dev/Reminder/node_modules/react-native-reanimated/src/reanimated2/index.ts: 
None of these files exist:
  * node_modules/react-native-reanimated/src/reanimated2/interpolateColor(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
  * node_modules/react-native-reanimated/src/reanimated2/interpolateColor/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
> 1 | export * from './core';
  2 | export * from './hook';
  3 | export * from './animation';
  4 | export * from './interpolation';

now I am trying to run

npm i react-native-maps-directions

And I am unable to install the package for the following reason:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@"*" from [email protected]
npm ERR!   node_modules/react-native-maps-directions
npm ERR!     react-native-maps-directions@"*" from the root project
npm ERR!   3 more (react-native, react-native-maps, react-native-web)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from [email protected]
npm ERR! node_modules/react-dom
npm ERR!   react-dom@"^17.0.1" from the root project
npm ERR!   peer react-dom@">=17.0.1" from [email protected]
npm ERR!   node_modules/react-native-web
npm ERR!     react-native-web@"^0.17.1" from the root project
npm ERR!     1 more (react-native-maps)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/seven/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/seven/.npm/_logs/2022-03-11T09_08_16_642Z-debug.log

Any ideas whay is it happening and what should I do? I'd appreciate any help. Thanks.

Upvotes: 2

Views: 1171

Answers (1)

Eragon_18
Eragon_18

Reputation: 770

run either npm install react-native-maps-directions --force or npm install react-native-maps-directions --legacy-peer-deps

this will ignore the peer dependency error, and will just proceed with the main dependency, in this case react-native-maps-directions.

this has worked for me whenever i've gotten this error

Upvotes: 2

Related Questions