b.andarzian
b.andarzian

Reputation: 53

Cannot find module 'react-native-reanimated/plugin' from /projectFolder

I wanted to use react-native-router-flux so i added its dependencies as described in its documents. I also added babel plugin dependency for react-native-reanimated in babel.config.js as below:

module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: ['react-native-reanimated/plugin'],};

But now im getting this error in metro server:

error: index.js: Cannot find module 'react-native-reanimated/plugin' from '/home/nia/Downloads/YarAb'

my react-native version is 0.63.2

Upvotes: 5

Views: 18264

Answers (2)

Rom
Rom

Reputation: 31

https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

yarn add react-native-reanimated

npm start -- --reset-cache

expo start -c

worked for me

Upvotes: 3

user14000437
user14000437

Reputation:

unfortunately, expo sdk v38 doesn't support reanimated v2 yet, because "reanimated 2 only supports hermes at the moment".

this problem is also documented in the react-native-reanimated v2 docs: "expo support is not ready yet, next sdk release will support react native 0.62 – this will allow you to use reanimated 2 in the ejected expo app."

the only solution for the moment is to either eject your expo app in order to use reanimated, or look for alternatives, like react-native-animatable.

https://github.com/software-mansion/react-native-reanimated/issues/886

Upvotes: 2

Related Questions