`react-native init AwesomeProject` throwing SyntaxError

后端 未结 3 447
情话喂你
情话喂你 2021-01-21 22:30

react-native init AwesomeProject is throwing SyntaxError: Unexpected token : and I\'m not sure why. I\'ve uninstalled and re-installed react-native-cli

3条回答
  •  清歌不尽
    2021-01-21 23:06

    Looks like the error an update was published to react-native. Others are experiencing the same issue so I'm going to answer this and say it's a package issue. https://github.com/facebook/react-native/issues/11384


    Until this gets resolved, you can use rninit(https://www.npmjs.com/package/rninit) to install using the previous version of react-native. This worked for me:
    rninit init mobile --source react-native@0.39.0

提交回复
热议问题