question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using react-native cli after upgrading to v0.40.0-rc.*

See original GitHub issue

Description

Upgraded from v0.39.0 to v0.40.0-rc.1 When executing run-android or upgrade, the following output is displayed.

...\node_modules\babel-core\lib\transformation\file\index.js:600
      throw err;
      ^

SyntaxError: .../node_modules/react-native/packager/react-packager/src/Bundler/index.js: Unexpected token, expected ) (42:8)
  40 |
  41 | export type GetTransformOptions<T> = (
> 42 |   string,
     |         ^
  43 |   Object,
  44 |   string => Promise<Array<string>>,
  45 | ) => T | Promise<T>;
    at Parser.pp$5.raise (...\node_modules\babylon\lib\index.js:4215:13)
    at Parser.pp.unexpected (...\node_modules\babylon\lib\index.js:1599:8)
    at Parser.pp.expect (...\node_modules\babylon\lib\index.js:1587:33)
    at Parser.pp$7.flowParsePrimaryType (...\node_modules\babylon\lib\index.js:4952:14)
    at Parser.pp$7.flowParsePostfixType (...\node_modules\babylon\lib\index.js:5025:38)
    at Parser.pp$7.flowParsePrefixType (...\node_modules\babylon\lib\index.js:5041:17)
    at Parser.pp$7.flowParseIntersectionType (...\node_modules\babylon\lib\index.js:5047:19)
    at Parser.pp$7.flowParseUnionType (...\node_modules\babylon\lib\index.js:5057:19)
    at Parser.pp$7.flowParseType (...\node_modules\babylon\lib\index.js:5068:19)
    at Parser.pp$7.flowParseTypeInitialiser (...\node_modules\babylon\lib\index.js:4393:19)

It is the first time I encountered this error. Downgrading back to 0.39.0 fixes this issue.

Additional Information

  • React Native version: 0.40.0-rc.1
  • Platform: Android. Not tested for iOS
  • Operating System: Windows 10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
GantMancommented, Dec 7, 2016

I had the same issue. Blowing away my node_modules and re-installing fixed it for me.

5reactions
mklbcommented, Mar 13, 2017

Running the following should fix it npm install --save babylon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading to new versions - React Native
There's currently two ways for upgrading your React Native project: by using React Native CLI or manually with Upgrade Helper.
Read more >
React Native version mismatch - Stack Overflow
I use rm -rf $TMPDIR/react-* to get rid of any cached builds. If that doesn't work, I try to build the app in...
Read more >
Troubleshooting common React Native bugs - LogRocket Blog
This troubleshooting guide shares how to easily find and address common React Native bugs. See common error examples.
Read more >
react-native - npm
React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access ......
Read more >
How to Fix a React Native Version Mismatch Quickly - Waldo
Version Mismatch Error in React Native · Creating a blank React Native project using either React Native CLI or Expo CLI · Starting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found