错误环境
新版本存在不兼容,在运行 react-native run-android [备注:红色的字体是小写的哦] 的时候,发生的错误分析:
$
react-native -v:react-native-cli: 2.0.1 react-native: 0.47.1$
node -v:v7.8.0$
npm -v:4.4.4babel-preset-react-native version : @3.0.0 存在问题,需要版本回退
解决方案
- 方案1:使用 yarn 工具
- $
yarn remove babel-preset-react-native - $
yarn add babel-preset-react-native@2.1.0
- $
- 方案2:使用 npm 工具
- $
npm uninstall --save-dev babel-preset-react-native - $
npm install babel-preset-react-native@2.1.0
- $
参考
- https://github.com/facebook/react-native/issues/15513
- https://github.com/facebook/react-native/issues/15545
总结
- 在发布新包的时候,需要进行严格测试,否则可能会造成大量用户的终端出现问题,从而导致在github上开issue的冲动 …
909



被折叠的 条评论
为什么被折叠?



