обновить react-native-maps для работы с create-react-native-app

Когда я запускаю приложение create-react-native-app, я получаю одноранговую зависимость для react-native-maps, чтобы использовать [email protected]. Мне нужно использовать [email protected] и [email protected]

Ниже представлен файл package.json для react-native-maps. Строка уведомления 81,82,97 и 98

может кто-нибудь показать, как отредактировать этот файл json и как обновить собственные карты реакции? Когда я попробовал:

npm --depth 9999 update

В итоге я получил массу ошибок о повторяющихся пакетах.

{
  "_from": "[email protected]",
  "_id": "[email protected]",
  "_inBundle": false,
  "_integrity": "sha512-FkCCV1AyaT5ut5ZTKNIdFWBxRUXZovGTydy7U4Cyifj2dv0Q3Sv21B0Myj+aoGhJhvBJzxsU25dDGQN3TP7b/Q==",
  "_location": "/react-native-maps",
  "_phantomChildren": {
    "babel-plugin-check-es2015-constants": "6.22.0",
    "babel-plugin-syntax-async-functions": "6.13.0",
    "babel-plugin-syntax-class-properties": "6.13.0",
    "babel-plugin-syntax-flow": "6.18.0",
    "babel-plugin-syntax-jsx": "6.18.0",
    "babel-plugin-syntax-trailing-function-commas": "6.22.0",
    "babel-plugin-transform-class-properties": "6.24.1",
    "babel-plugin-transform-es2015-arrow-functions": "6.22.0",
    "babel-plugin-transform-es2015-block-scoping": "6.26.0",
    "babel-plugin-transform-es2015-classes": "6.24.1",
    "babel-plugin-transform-es2015-computed-properties": "6.24.1",
    "babel-plugin-transform-es2015-destructuring": "6.23.0",
    "babel-plugin-transform-es2015-for-of": "6.23.0",
    "babel-plugin-transform-es2015-function-name": "6.24.1",
    "babel-plugin-transform-es2015-literals": "6.22.0",
    "babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
    "babel-plugin-transform-es2015-parameters": "6.24.1",
    "babel-plugin-transform-es2015-shorthand-properties": "6.24.1",
    "babel-plugin-transform-es2015-spread": "6.22.0",
    "babel-plugin-transform-es2015-template-literals": "6.22.0",
    "babel-plugin-transform-flow-strip-types": "6.22.0",
    "babel-plugin-transform-object-assign": "6.22.0",
    "babel-plugin-transform-object-rest-spread": "6.26.0",
    "babel-plugin-transform-react-display-name": "6.25.0",
    "babel-plugin-transform-react-jsx": "6.24.1",
    "babel-plugin-transform-react-jsx-source": "6.22.0",
    "babel-plugin-transform-regenerator": "6.26.0",
    "lodash": "4.17.10",
    "react-transform-hmr": "1.0.4"
  },
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "[email protected]",
    "name": "react-native-maps",
    "escapedName": "react-native-maps",
    "rawSpec": "0.21.0",
    "saveSpec": null,
    "fetchSpec": "0.21.0"
  },
  "_requiredBy": [
    "/expo"
  ],
  "_resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-0.21.0.tgz",
  "_shasum": "005f58e93d7623ad59667e8002101970ddf235c2",
  "_spec": "[email protected]",
  "_where": "d:\\atestbed\\native-react\\lecture4-contacts\\node_modules\\expo",
  "author": {
    "name": "Leland Richardson",
    "email": "[email protected]"
  },
  "bugs": {
    "url": "https://github.com/airbnb/react-native-maps/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "babel-plugin-module-resolver": "^2.3.0",
    "babel-preset-react-native": "1.9.0"
  },
  "deprecated": false,
  "description": "React Native Mapview component for iOS + Android",
  "devDependencies": {
    "babel-eslint": "^6.1.2",
    "babel-preset-airbnb": "^1.1.1",
    "eslint": "^3.3.1",
    "eslint-config-airbnb": "^10.0.1",
    "eslint-plugin-import": "^1.14.0",
    "eslint-plugin-jsx-a11y": "^2.1.0",
    "eslint-plugin-prefer-object-spread": "^1.1.0",
    "eslint-plugin-react": "^6.1.2",
    "gitbook-cli": "^2.3.0",
    "lodash": "^4.17.2",
    "prop-types": "^15.5.10",
    "react": "^16.3.0-alpha.1",
    "react-native": "^0.54"
  },
  "homepage": "https://github.com/airbnb/react-native-maps#readme",
  "keywords": [
    "react",
    "react-native",
    "react-component",
    "map",
    "mapview",
    "google-maps",
    "mapkit"
   ],
  "main": "index.js",
  "name": "react-native-maps",
  "peerDependencies": {
    "react": "^16.0",
    "react-native": "^0.51 || ^0.52 || ^0.53 || ^0.54",
    "prop-types": "^15.0 || ^16.0"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/airbnb/react-native-maps.git"
  },
  "rnpm": {
    "android": {
      "sourceDir": "./lib/android"
    }
  },
  "scripts": {
    "build": "npm run build:js && npm run build:android && npm run build:ios",
    "build:android": "./gradlew :react-native-maps:assembleDebug",
    "build:ios": "bundle install --path ./example/ios/bundles && bundle exec pod install --project-directory=./example/ios/",
    "build:js": "exit 0",
    "ci": "npm run lint",
    "lint": "eslint ./",
    "preversion": "./scripts/update-version.js",
    "run:android": "./gradlew installDebug && npm run start:android",
    "run:ios": "react-native run-ios --project-path ./example/ios",
    "run:packager": "./node_modules/react-native/packager/packager.sh",
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "start:android": "adb shell am start -n com.airbnb.android.react.maps.example/.MainActivity"
  },
  "version": "0.21.0"
}

person DCR    schedule 16.05.2018    source источник


Ответы (1)


Хорошо, так что если мы просто обновим файл package.json для react-native-maps следующим образом:

under devDependencies:
    "react": "^16.3.1",
    "react-native": "^0.55.2"

under peerDependencies:
    "react": "^16.3.1",
    "react-native": "^0.55",

затем обратно в верхний проект установите [email protected] и [email protected] и добавьте их в зависимости в package.json.

person DCR    schedule 16.05.2018