React-native-maps 因版本错误而失败

React-native-maps fail with wrong version

使用 React Native 进行第一步ps。试图在模拟器中显示地图。失败:

React native 版本不匹配

JavaScript 版本 0.54.4

原生版本0.55.2

我正在按照 react-native.com and the react-native-maps

上的示例进行操作
create-react-native-app MyMap
cd MyMap
npm install react-native-maps --save
vi App.js

添加import MapView from 'react-native-maps';

添加

<MapView
    initialRegion={{
      latitude: 37.78825,
      longitude: -122.4324,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    }}
  />

npm run ios

在模拟器中出现上述错误而失败。在终端中它告诉我 maps 需要 react-native 0.52 - 0.54 而默认安装附带的最新版本是 0.55.

ps。 运行 用于开发的全新 OSX 10.13.4 Parallels-VM。不确定这是否是一个问题? pps。 运行 没有 maps 编辑的应用程序工作正常。

尝试使用较旧的 react-native 版本安装您的项目。

react-native init --version="0.54.0" MyMap

这可能有帮助: