Closed
Description
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.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Kennytian commentedon Aug 18, 2017
some issue +1
@tudor2it work around:
npm install --save-dev babel-preset-react-native@2.1.0
emilioicai commentedon Aug 18, 2017
+1
@Kennytian workaround fixed it
tudor2it commentedon Aug 18, 2017
@Kennytian Thank you for the solution. I have known about the workaround. The issue has appeared a few days ago and I've expected to disappear. But it is still there and it's frustrating that the react-native team didn't fix it. I'm desperate to finish a project and I'm only struggling with all kind of errors because versions of packages and compilers don't match.
snoo-mpl commentedon Aug 18, 2017
+1
workaround didnt fix it in my app:
npm: 5.0.1
react-native-cli: 2.0.1
react-native: 0.47.1
node: v7.9.0
charpeni commentedon Aug 18, 2017
@facebook-github-bot duplicate #15513
facebook-github-bot commentedon Aug 18, 2017
Duplicate of #15513
ShubhamBabhulkar commentedon Aug 19, 2017
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
oliverraf commentedon Aug 20, 2017
This works like a charm
@tudor2it work around: npm install --save-dev babel-preset-react-native@2.1.0
kwesihackman commentedon Aug 20, 2017
workaround fixed it for me
gjvpaet commentedon Aug 20, 2017
@Kennytian workaround fixed it thanks!
uurtsaikhb commentedon Aug 21, 2017
@Kennytian workaround fixed it, thank you
jmacias54 commentedon Aug 21, 2017
@Kennytian fixed it, thank you so much
vegano1 commentedon Aug 25, 2017
@ShubhamBabhulkar This fixed my issue as well. Thank you.
17 remaining items