小编Abh*_*ram的帖子

错误:无法初始化react-native-reanimated库

我正在开发一个关于 React Native 的项目,试图创建抽屉导航

  • 我安装了导航抽屉、手势处理程序和重新启动的库

  • 当我运行时,我收到错误第一个错误:

    错误错误:无法初始化react-native-reanimated库,请确保您按照此处的安装步骤操作: https: //docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

    1. 确保 reanimated 的 babel 插件安装在 babel.config.js 中(你应该在那里列出“react-native-reanimated/plugin” - 另请参阅上面的链接了解详细信息)
    2. 确保在更新配置后重置构建缓存,运行:yarn start --reset-cache,js引擎:hermes

所以我根据这个错误中的建议,在 babel.config.js 中添加了plugins:['react-native-reanimated/plugin',并从 npm start ----reset 缓存开始,这给了我另一个错误:

第二个错误

error: index.js: Unknown option: .Plugins. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
Run Code Online (Sandbox Code Playgroud)

这是我的 package.json

{
  "name": "Train",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-navigation/drawer": "^6.5.0",
    "@react-navigation/native": "^6.0.13",
    "@react-navigation/stack": "^6.3.1",
    "react": "18.1.0", …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native expo react-native-reanimated

10
推荐指数
3
解决办法
2万
查看次数