2
votes

Following the instructions for initial setup I stucked when found a red screen with:

ReferenceError: Can't find variable: __fbBatchedBridge (line 1 in the generated bundle)

After reloading it changes and becomes:

Unable to download JS bundle

Than I found an advice for typing react-native start into the console. The result:

react-native start

/local/react_native/android_program1/node_modules/react-native/local-cli/cli.js:74 const setupEnvScript = /^win/.test(process.platform) ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Module._extensions..js (module.js:474:10) at Object.require.extensions.(anonymous function) [as .js] (/local/react_native/android_program1/node_modules/react-native/node_modules/babel-core/node_modules/babel-register/lib/node.js:142:7) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/local/react_native/android_program1/node_modules/react-native/cli.js:15:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10)

I'm using:

RHEL 7, npm 1.3.6, nodejs 0.10.36 and react-native 0.19.

How can I make it work?

1
I can just guess but you need nodejs 4.0 or newer (as stated in the guide) for React-native. - AMilassin
Also, React-native is at 0.19 at the moment. What is "0.1.10"? - AMilassin
sorry, cli is 0.1.10, react-native is 0.19. - user5918250
Can you give maybe any idea how to update nodejs on RHEL 7? - user5918250
I would try something like github.com/creationix/nvm to support multiple node versions on the same system. - AMilassin

1 Answers

0
votes
  1. install node js
  2. open command promt.
  3. type: react-native init projectName this command will automatically download all the required dependancies for project.
  4. open the directory from cmd using cd projectname
  5. react-native run-android

if u face the error like : make sure you have npm install. then just exicute this command npm install --save

your project will run successfully. hope it work for you..