React Native UNMET PEER DEPENDENCY react@16.0.0-alpha.6

从0.44版本开始,Navigator被从react native的核心组件库中剥离到了一个名为react-native-deprecated-custom-components的单独模块中。如果你需要继续使用Navigator,则需要先npm i -S react-native-deprecated-custom-components,然后从这个模块中import,即import { Navigator } from 'react-native-deprecated-custom-components'.

执行

react-native-deprecated-custom-components

出现问题
UNMET PEER DEPENDENCY react@16.0.0-alpha.6

解决方法
进入工程目录 执行

 npm init

此时会自动生成一个package.json文件

接下来在执行

react-native-deprecated-custom-components

就可以正常使用了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容