简体   繁体   English

React-Native-Reanimated: 错误: node_modules\react-native-reanimated\src\index.ts:

[英]React-Native-Reanimated: error: node_modules\react-native-reanimated\src\index.ts:

I was making new project and I can't run the android emulator with this error.我正在制作新项目,但无法运行 android 模拟器并出现此错误。

在此处输入图像描述

在此处输入图像描述

It is located at 'node_modules\react-native-reanimated\src\index.ts' and this is just the code there:它位于“node_modules\react-native-reanimated\src\index.ts”,这只是那里的代码:

// tree-shaken side effects
import './reanimated2/js-reanimated/global';

// @ts-ignore backward compatibility with treeshaking
export * from './reanimated1';
export * from './reanimated2';
export * as default from './Animated';

在此处输入图像描述

Im not sure what to do, please help.我不确定该怎么做,请帮忙。 Thank you in advance!先感谢您!

I also search for an answer and this worked for me.我也在寻找答案,这对我有用。

Visit this expo reanimated docs link https://docs.expo.dev/versions/latest/sdk/reanimated/#installation访问此 expo 重新动画文档链接https://docs.expo.dev/versions/latest/sdk/reanimated/#installation

and I added this in my 'babel.config.js' file我在我的“babel.config.js”文件中添加了这个

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['module:metro-react-native-babel-preset'],
    plugins: ['react-native-reanimated/plugin'],
  };
};

I think the presets depends if you are using expo.我认为预设取决于您是否使用 expo。 Here is the original code given by the docs:这是文档给出的原始代码:

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'],
  };
};

you can see that I used my default preset which is module:metro.你可以看到我使用了我的默认预设,即 module:metro。

i have the same issue, This version works for me我有同样的问题,这个版本适合我

    "react-native-reanimated": "2.9.1"

I ran this command expo start -c everything was working fine.我运行了这个命令expo start -c一切正常。 After that, I've stopped the app with Ctrl+c and run a normal npm start and there were no problems with it since在那之后,我用Ctrl+c停止了应用程序并运行正常的npm start并且没有问题,因为

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:需要模块“node_modules\react-native-reanimated\src\Animated.js” - Error: Requiring module "node_modules\react-native-reanimated\src\Animated.js" ReactNative 错误:任务 ':react-native-reanimated:checkDebugManifest' 执行失败 - ReactNative error: Execution failed for task ':react-native-reanimated:checkDebugManifest' React Native 中的任务 ':react-native-reanimated:androidJavadoc' 执行失败 - Execution failed for task ':react-native-reanimated:androidJavadoc' in React Native 评估项目“:react-native-reanimated”时出现问题 - A problem occurred evaluating project ':react-native-reanimated' 运行反应原生裸项目导致错误配置项目':react-native-reanimated'时出现问题 - Running react native bare project results in error A problem occurred configuring project ':react-native-reanimated' react-native-reanimated react-native-screens 未打开反应本机应用程序 - react native Application doesn't open with react-native-reanimated react-native-screens installed react-native-reanimated:configureCMakeDebug[arm64-v8a] 安装 react-native-vision-camera 后出错 - react-native-reanimated:configureCMakeDebug[arm64-v8a] error after install react-native-vision-camera 构建失败“配置项目时出现问题:react-native-reanimated”。 在 React Native 项目中 - Build failed 'A problem occurred configuring project ':react-native-reanimated'. in React native project React Native - 无法确定任务':react-native-reanimated:generateJsonModelDebug'的依赖关系 - React Native - Could not determine the dependencies of task ':react-native-reanimated:generateJsonModelDebug' react-native-reanimated:androidJavadoc 在 android 设备上运行 react-native 应用程序时出错 - react-native-reanimated:androidJavadoc errors running react-native app on android devices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM