今天从github拉项目下来,想欣赏一下大佬的项目,
结果:遇到各种问题:
1.没有npm,说来奇怪,react-native项目初始化的时候都需要去安装npm,那我就安装嘛,
执行命令:
npm install react-native
接着又给我报错:(这次有图了)

鬼才知道你报的什么错。
找了很久找到答案:


这就是问题所在:
rn的0.56版本貌似有问题,依赖有问题。
我们只能将它降级,推荐0.55.4.
所以执行命令:
npm uninstall react-native
npm install --save react-native@0.55.4
先卸载,再安装。
如果还不行的话就再执行:
npm install --save babel-preset-react-native@4.0.0
如果顺利的话就可以运行了。
网友评论