我所做的导致错误:,我有一个新安装的裸反应本机项目。我想使用抽屉导航,并不得不安装ResiveNativative2.3.0-alpha 2。
我已经尝试解决错误的
我已经安装了新鲜的、裸的、反应本机project
中的所有步骤
误差
BUNDLE ./index.js
错误: index.js:无法找到模块‘babel-plugin’要求堆栈:
原生反应
发布于 2022-02-09 03:24:33
我希望你已经解决了这个问题。但以防万一或其他人需要它,在我的情况下,这是由于省略(.)当我从说明中复制这部分代码时,我离开了:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
... //<---HERE Remove this
'react-native-reanimated/plugin',
],
};https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
发布于 2021-11-07 04:23:26
这是一个与babel有关的问题。
确保安装
"@babel/core":"^7.12.9",
“@babel/运行时”:"^7.16.0“
@babel/运行时"^7.16.0",
或者不管最新版本是什么。
在babel.config.js文件中添加以下内容:
plugins: [
[
'@babel/plugin-transform-runtime',
{
absoluteRuntime: false,
corejs: false,
helpers: true,
regenerator: true,
version: '7.0.0-beta.0',
},
],
'react-native-reanimated/plugin',
],如果您有其他插件,请确保恢复插件是最后一个插件。对于其他措施,删除节点模块并清除缓存。这里有更多信息:https://babeljs.io/docs/en/babel-plugin-transform-runtime
发布于 2022-09-14 06:58:02
去掉椭圆对我来说绝对有效..。
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
... //<- Removing these ellipses worked for me
"react-native-reanimated/plugin",
],
};
};https://stackoverflow.com/questions/68972567
复制相似问题