初始化反应,本机应用程序我得到下面的语法错误,当我使用初始化react-native init MyApp
同时使用CLI
SyntaxError: /Users/MyAccount/RNProjects/app/node_modules/react-native/packager/react-packager/src/node-haste/index.js: You can only use Class Properties when the 'classProperties' plugin is enabled. (389:2)
387 | }
388 |
> 389 | static Cache;
| ^
390 | static Module;
391 | static Polyfill;
392 | static getAssetDataFromName;
at Parser.pp$5.raise (/Users/MyAccount/RNProjects/app/node_modules/babylon/lib/index.js:4380:13)
我不知道为什么会这样突然的一个应用程序中的语法错误。之前它工作得很好。我想我在修补时误删了一些配置文件。
我也遇到过这种情况。版本是:react-native-cli:2.0.1,react-native:0.41.2,yarn:0.20.3,node:v7.6.0 – IAmFledge