简体   繁体   中英

react-native run-android command fails

On ubuntu 14.04 I try to launch hello world project. I get the following output when print react-native run-android

/home/jonstark/AwesomeProject/node_modules/react-native/local-cli/cli.js:73 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] (/home/jonstark/AwesomeProject/node_modules/babel-register/lib/node.js:138: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. (/home/jonstark/AwesomeProject/node_modules/react-native/cli.js:15:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10)

What do I do to get it working?

I tried to update nodejs with sudo npm install -gn Then node -v shows

v0.10.25

Your node version is horribly outdated. See here for steps on how to update it on Ubuntu: https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM