React-native: Invalid character in findSymlinkModules.js line 37 when running react-native run-android

Created on 19 Oct 2017  路  9Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

No

Environment

```Environment:
OS: Linux 4.8
Node: 8.5.0
Yarn: Not Found
npm: 5.3.0
Watchman: 4.9.0

### Issue

When I run `react-native run-android` I get 

/home/yenda/status-react/node_modules/react-native/local-cli/util/findSymlinkedModules.js:37
ignoredRoots? = [])
^

SyntaxError: Unexpected token ?
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:588:28)
at loader (/home/yenda/status-react/node_modules/metro-bundler/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/yenda/status-react/node_modules/metro-bundler/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
`` Removing the?` fixes it.
https://github.com/facebook/react-native/blob/master/local-cli/util/findSymlinkedModules.js#L37

Locked

Most helpful comment

I have the same issue, any other fix?

All 9 comments

Hi @yenda!

Strange, looks like for some reason it doesn't stripe out flow types 馃 Do you have a custom setup or something? How can I reproduce this issue?

Hi @Kureev ,

I am not really familiar with javascript ecosystem so I am not sure what you mean by striping flow types.
Is it related to flowconfig ? Here is our project flowconfig file https://github.com/status-im/status-react/blob/develop/.flowconfig

What part of my setup would be relevant to you besides the project itself ?

I just deleted my repo and re-cloned it and the error disappeared

I had the exact same issue. Yenda's turn it off and back on again approach miraculously worked for me too. thanks

I have the same issue in an iOS project. Re-cloning did not help.

cleaning my node_module folder helped, almost same as recloning

I had [email protected] in my yarn.lock. Recreating the yarn.lock installed v6.22.0 and fixed this issue.

I have the same issue, any other fix?

i just removed "?" from the file and it worked

Was this page helpful?
0 / 5 - 0 ratings