错误:index.js:找不到模块“babel-plugin-r”React Native

mr.*_*aan 5 android navigation-drawer react-native react-navigation react-native-reanimated-v2

我做了什么导致了错误: 我有一个新安装的 Bare React Native Project 。我想使用抽屉导航并且必须安装 React Native Reanimated 2.3.0-alpha.2 。

我已经尝试解决该错误

错误

捆绑./index.js

错误:index.js:找不到模块“babel-plugin-r”需要堆栈:

  • D:\Work\React Native\React Native with Node\healthapp\node_modules@babel\core\lib\config\files\plugins.js
  • D:\Work\React Native\React Native with Node\healthapp\node_modules@babel\core\lib\config\files\index.js
  • D:\Work\React Native\React Native with Node\healthapp\node_modules@babel\core\lib\index.js
  • D:\Work\React Native\React Native with Node\healthapp\node_modules\metro-transform-worker\src\index.js
  • D:\Work\React Native\React Native with Node\healthapp\node_modules\metro\src\DeltaBundler\Worker.js
  • D:\Work\React Native\React Native with Node\healthapp\node_modules\metro\node_modules\jest-worker\build\workers\processChild.js

小智 19

我希望你已经解决了这个问题。但以防万一或其他人在我的情况下需要它,这是由于当我从说明中复制这部分代码时留下的省略号(...):

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
      ... //<---HERE Remove this
      'react-native-reanimated/plugin',
  ],
};
Run Code Online (Sandbox Code Playgroud)

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