react-native init的时候出现问题:npm WARN React-native@0.35.0 requires a peer of react@~15.3.1 but none was

来源:互联网 发布:山东省农产品出口数据 编辑:程序博客网 时间:2024/05/18 13:46

react-native init的时候出现问题:

报错信息

npm WARN React-native@0.35.0 requires a peer of react@~15.3.1 but none was installed.

解决方案:

方法一:npm install -save react@~15.3.1

方法二:在package.json中可以添加依赖

"dependencies": { 
"react": "^15.3.2", 
"react-native": "^0.35.0", 
"react-native-orientation": "^1.17.0", 
"react-native-scrollable-tab-view": "^0.6.0", 
}