Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
617 views
in Technique[技术] by (71.8m points)

android - bundling failed: Error: Plugin 0 provided an invalid property of "default"

I'm trying to run a react native app on my AVD using this command :

react-native run-android

but getting the following error:

 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:UsersASUSest
ode_modulesabel-corelibransformationplugin.js:131:13)
    at Function.normalisePlugin (C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:152:12)
    at C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:158:20)
    at OptionManager.mergeOptions (C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:234:36)
    at C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:265:14
    at C:UsersASUSest
ode_modulesabel-corelibransformationfileoptionsoption-manager.js:323:22
    at Array.map (<anonymous>)

.babelrc :

{
  "presets": [
    "react-native"
    "@babel/preset-flow"
  ]
}

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"
  }
}

I'm using Windows , node.js v 8.11.3 & react native v 0.55.4

I've already tried everything recommended on internet(specially github) but still no luck. Really appreciate it if some one can help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is bug in babel-preset-react-native

Set the version:

yarn remove babel-preset-react-native
yarn add [email protected]

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...