Can't add reanimated package on react-native project, I am getting this error when i ran the app:
Error: While trying to resolve module
react-native-reanimated
from file/Users/.../app/index.android.js
, the package/Users/...p/node_modules/react-native-reanimated/package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (/Users/.../node_modules/react-native-reanimated/lib/Animated.js
. Indeed, none of these files exist:
I am thinking of using babel-plugin-module-resolver to alias it and this is my babel.config.js but i am not sure if it will resolve 'react-native-reanimated' from other packages dependent to it:
module.exports = {
env: {
production: {
plugins: ['transform-remove-console', 'react-native-reanimated/plugin'],
},
},
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
require.resolve('babel-plugin-module-resolver'),
{
root: ['.'],
extensions: ['.android.js', '.ts', '.tsx', '.jsx', '.js'],
alias: {
'react-native-reanimated': 'react-native-reanimated/src/Animated',
},
},
],
'react-native-reanimated/plugin',
],
};
but same error, help?