[英]react-native run-android command fails
On ubuntu 14.04 I try to launch hello world project. 在ubuntu 14.04上,我尝试启动hello world项目。 I get the following output when print
react-native run-android
打印
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.
/home/jonstark/AwesomeProject/node_modules/react-native/local-cli/cli.js:73 const setupEnvScript = /^win/.test(process.platform)^^^^^ SyntaxError:在严格模式下使用const。 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.
在Module._compile(module.js:439:25)在Module._extensions..js(module.js:474:10)在Object.require.extensions。(匿名函数)[作为.js](/ home / jonstark /AwesomeProject/node_modules/babel-register/lib/node.js:138:7)位于Module.Function.Module._load(module.js:312:12)处于Module.load(module.js:356:32)。在Object的require(module.js:380:17)处需要(module.js:364:17)。 (/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)
(/home/jonstark/AwesomeProject/node_modules/react-native/cli.js:15:18)在Module._compile(module.js:456:26)在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 我试图用
sudo npm install -gn
更新nodejs,然后node -v
显示
v0.10.25
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
有关如何在Ubuntu上进行更新的步骤,请参见此处: https : //askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.