Javascript 指定了插件0,提供了无效的属性";“违约”;(开玩笑)
嘿,我只是试着运行一个简单的测试,在运行了“纱线测试”之后,我一直遇到这个错误,这是在开玩笑Javascript 指定了插件0,提供了无效的属性";“违约”;(开玩笑),javascript,react-native,jestjs,Javascript,React Native,Jestjs,嘿,我只是试着运行一个简单的测试,在运行了“纱线测试”之后,我一直遇到这个错误,这是在开玩笑 Plugin 0 specified in "/Users/Documents/Dev/appname/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/Users/Documents/Dev/appname/node
Plugin 0 specified in "/Users/Documents/Dev/appname/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/Users/Documents/Dev/appname/node_modules/babel-preset-react-native/index.js")
at Plugin.init (node_modules/babel-core/lib/transformation/plugin.js:131:13)
at Function.normalisePlugin (node_modules/babel-core/lib/transformation/file/options/option-manager.js:152:12)
at node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
at node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
at Array.map (<anonymous>)
at OptionManager.resolvePresets (node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
我不知道你是否已经解决了这个问题,但我也遇到了同样的问题,我能够用RN 0.56使事情再次正常工作。我改变了这一点:
"babel-preset-react-native": "^5",
到
以下是关于这个问题的完整讨论:
如果上述情况破坏了react原生环境,另一种解决方案是安装巴别塔桥:
npm install babel-core@7.0.0-bridge.0 --save-dev
"babel-preset-react-native": "4.0.0",
npm install babel-core@7.0.0-bridge.0 --save-dev