Android 绑定失败:错误:插件0提供了无效的属性";“违约”;
我正在尝试使用以下命令在我的AVD上运行react本机应用程序:Android 绑定失败:错误:插件0提供了无效的属性";“违约”;,android,node.js,react-native,runtime-error,babeljs,Android,Node.js,React Native,Runtime Error,Babeljs,我正在尝试使用以下命令在我的AVD上运行react本机应用程序: react-native run-android 但是得到以下错误: bundling failed: Error: Plugin 0 specified in "C:\\Users\\ASUS\\test\\node_modules\\babel-preset-react-native\\index.js" provided an invalid property of "default" (While processing
react-native run-android
但是得到以下错误:
bundling failed: Error: Plugin 0 specified in "C:\\Users\\ASUS\\test\\node_modules\\babel-preset-react-native\\index.js" provided an invalid property of "default" (While processing preset: "C:\\Users\\ASUS\\test\\node_modules\\babel-preset-react-native\\index.js")
at Plugin.init (C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\plugin.js:131:13)
at Function.normalisePlugin (C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:152:12)
at C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
at OptionManager.mergeOptions (C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
at C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14
at C:\Users\ASUS\test\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22
at Array.map (<anonymous>)
package.json:
{
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.4.1",
"react-native": "^0.55.4"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "5.0.2",
"jest": "23.4.1",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
我使用的是Windows、node.jsv8.11.3和react native v0.55.4
我已经尝试了互联网上推荐的所有东西(特别是github),但仍然没有成功。如果有人能帮上忙,我将不胜感激。这是《巴别塔》中的bug 设置版本:
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0
如果使用最新版本的笑话,它可以工作
《巴别塔笑话》:“23.3.0”,
“巴别塔预设反应本机”:“5.0.2”,
“笑话”:“23.3.0”,
在React native中存在一些不兼容的版本控制问题。试试这个,它会起作用的
1.在包.json中更改以下版本
在依赖项中:-
"react": "16.3.1"
"react-native": "0.55.4"
"babel-preset-react-native": "2.1.0"
在DevDependence中:-
"react": "16.3.1"
"react-native": "0.55.4"
"babel-preset-react-native": "2.1.0"
二,。删除节点模块并运行npm安装-保存
它将运行良好…很好,可能会晚些,但我将帮助其他人,如下所示。json将一直工作到2018年8月20日 下面package.json大多数依赖项,如axios、Redux、Native base、react Native router flux..等,都在react Native项目中使用,因此我在下面提到的版本彼此兼容。 干杯
我有这个问题,我需要降级巴别塔的本机版本 如果你用纱线 或者使用npm命令
事实上,我把版本降到了4.0.0,但是你帮了很多忙才发现问题:)谢谢
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@4.0.0
npm uninstall babel-preset-react-native
npm install babel-preset-react-native@4.0.0