我尝试从“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
感谢提前
我从 brew 命令安装了节点 6.3.0。但是当前节点版本是 0.12.7 我通过执行以下操作解决了这个问题:
之后我就可以编译和运行了
关于ios - 从 "getting started"教程安装 React 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38489969/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |