不要使用 cnpm 安装 F8App, react-native.js:120 ...require('React'), SyntaxError: Unexpected token ...

不要使用 cnpm install 安装,不然运行时会报错。
开始被这个帖子误导浪费半天时间……

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ react-native run-android
/f8app/node_modules/.npminstall/react-native/0.23.1/react-native/Libraries/react-native/react-native.js:120
...require('React'),
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Module._extensions..js (module.js:442:10)
at Object.require.extensions.(anonymous function) [as .js] (/f8app/node_modules/.npminstall/babel-register/6.7.2/babel-register/lib/node.js:134:7)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at /f8app/node_modules/.npminstall/babel-core/6.7.7/babel-core/lib/transformation/file/options/option-manager.js:368:22
at Array.map (native)