我已尝试从" Getting Started"安装React Native。当我运行命令时:
react-native init AwesomeProject
我收到了这个错误,应用程序没有在模拟器中共进午餐。
~/tmp/react-native/AwesomeProject/node_modules/react-native/packager ~
/Users/david/tmp/react-native/AwesomeProject/node_modules/react-native/local-cli/server/formatBanner.js:48
chalkFunction: (fn) => fn,
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/david/tmp/react-native/AwesomeProject/node_modules/react-native/local-cli/server/checkNodeVersion.js:12:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
~ Process terminated. Press <enter> to close the window
我的系统信息:
Mac OS 10.11.6
节点:稳定6.3.0(瓶装),HEAD
守望者:稳定4.6.0(瓶装),HEAD
XCode 7.3.1
感谢您提前
答案 0 :(得分:0)
我从brew命令安装了节点6.3.0。但是当前节点版本是0.12.7我通过执行以下操作来修复此问题:
之后我就能编译并运行