react-native: [Getting Started] react-native run-ios got error: TransformError - Unexpected token
Is this a bug report?
Bundling index.ios.js
[development, non-minified, hmr disabled] 0.0% (0/1), failed.
error: bundling failed: “TransformError: /Users/imac/Documents/react-native/AwesomeProject/index.ios.js: Unexpected token ) (While processing preset: "/Users/imac/Documents/react-native/AwesomeProject/node_modules/babel-preset-react-native/index.js")”
Environment
react-native -v
: 0.47.1node -v
: 6.10.2npm -v
: 5.3.0
Then, specify:
- Target Platform: iOS
- Development Operating System: macOS Sierra
- Build tools: Terminal
Steps to Reproduce
Follow step by step as guide Building Projects with Native Code http://facebook.github.io/react-native/docs/getting-started.html#getting-started
Actual Behavior
Got error message as screenshot:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 18 (4 by maintainers)
@phuongwd probably related with this #15513 try to change the version:
@sharathprabhal , try to close the terminal that opened by the packager, it runs package at port 8081, close it will terminate the packager process, then you re-run
react-native run-ios
, it should work.I’m running into this in
^5.0.0
. Anyone else having this problem? I’ve tried several different versions ofbabel-preset-react-native
and haven’t had any luck.