捆绑失败:错误:插件0提供了"default"的无效属性. [英] bundling failed: Error: Plugin 0 provided an invalid property of "default"
本文介绍了捆绑失败:错误:插件0提供了"default"的无效属性.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用以下命令在我的AVD上运行react native应用程序:
I'm trying to run a react native app on my AVD using this command :
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>)
.babelrc:
{
"presets": [
"react-native"
"@babel/preset-flow"
]
}
package.json:
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.js v 8.11.3&反应原生v 0.55.4
I'm using Windows , node.js v 8.11.3 & react native v 0.55.4
我已经尝试了互联网上推荐的所有内容(特别是github),但还是没有运气.如果有人可以帮忙,我会非常感激.
I've already tried everything recommended on internet(specially github) but still no luck. Really appreciate it if some one can help.
推荐答案
这是babel-preset-react-native
设置版本:
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0
这篇关于捆绑失败:错误:插件0提供了"default"的无效属性.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文