react-native: error: bundling failed: "TransformError [...] (While processing preset: node_modules [... \\babel-preset-react-native\\index.js")"
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
No
Environment
react-native -v
: react-native-cli: 2.0.1node -v
: v6.11.2npm -v
: 3.10.10yarn --version
: not using
Then, specify:
- Target Platform: Android
- Development Operating System: Windows 7 Professional SP1 x86_64
- Build tools: Android Studio 2.3.3, JRE 1.8.0_122, Android SDK Tools 26.0.2
Steps to Reproduce
(Write your steps here:)
- D:\path\path>react-native init project
- cd project
- react-native run-android
Expected Behavior
The welcome React-Native screen should appear on the emulator screen.
Actual Behavior
It throws the below error:
React packager ready.
Loading dependency graph, done.
Bundling `index.android.js` [development, non-minified, hmr disabled] ░░░░░░░░░░░░░
Bundling `index.android.js` [development, non-minified, hmr disabled] 0.0% (0/1), f
ailed.
Bundling `index.android.js` [development, non-minified, hmr disabled] ░░░░░░░░░░░░░
error: bundling failed: "TransformError: D:\\path\\path\\project\\index.android.js: Unex
pected token ) (While processing preset: \"D:\\\\path\\\\path\\\\project\\\\node_modules
\\\\babel-preset-react-native\\\\index.js\")"
Reproducible Demo
It is an empty standard project as it is described in https://facebook.github.io/react-native/docs/getting-started.html > Building Projects with Native Code.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 25 (3 by maintainers)
Commits related to this issue
- adjust to workaround https://github.com/facebook/react-native/issues/15545 — committed to changtimwu/react-native-boilerplate-mobx-state-tree-typescript by changtimwu 6 years ago
some issue +1
@tudor2it work around:
npm install --save-dev babel-preset-react-native@2.1.0
for yarn used following Commands
yarn remove babel-preset-react-native yarn add babel-preset-react-native@2.1.0
for npm used following Commands
npm uninstall babel-preset-react-native npm install babel-preset-react-native@2.1.0
change to
This works like a charm
@tudor2it work around: npm install --save-dev babel-preset-react-native@2.1.0
npm reinstalls did not work for me. Only Yarn method
yarn remove babel-preset-react-native yarn add babel-preset-react-native@2.1.0
Getting similar error in android
Gettting this Error In Ios
TransformError: /Users/stellent/Desktop/terapanth/index.ios.js: Couldn't find preset "babel-preset-react-native-stage-0/decorator-support" relative to directory "/Users/stellent/Desktop/terapanth"
step1
npm install --save-dev babel-preset-react-native@2.1.0 step2 npm update