主要错误
“找不到匹配”2.7.1“的”react-native-background-geolocation-android“的任何版本”
环境
重现步骤
我试图在我现有的一个项目中添加react-native-tab-view库。所以我做了:
yarn add react-native-tab-view
在我的项目目录中。
预期行为
应该在我的项目中安装/添加库。
实际行为
它引发了意外错误:
yarn add react-native-tab-view
yarn add v1.0.2
info No lockfile found.
[1/4] Resolving packages...
warning polyline@0.2.0: This module is now under the @mapboxnamespace: install instead
warning connect@2.30.2: connect 2.x series is deprecated
warning node-uuid@1.4.7: Use uuid module instead
Couldn't find any versions for "react-native-background-geolocation-android" that matches "2.7.1"
? Please choose a version of "react-native-background-geolocation-android" from
this list: (Use arrow keys)
❯ 0.0.1-security
Furthur
如果我继续选择'0.0.1-security',我会在安装中遇到错误。
获取完整的错误日志:click here
Package.json文件:
{
"name": "MyAppName",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"build": "babel js/ -d lib/",
"prepublish": "npm run build",
"flow": "node_modules/.bin/flow",
"flow start": "flow start",
"flow stop": "flow stop",
"flow status": "flow status",
"flow coverage": "flow coverage"
},
"dependencies": {
"async": "^2.2.0",
"polyline": "^0.2.0",
"pusher-js": "4.1.0",
"react": "15.4.2",
"react-native": "0.42.3",
"react-native-animatable": "^1.1.1",
"react-native-appsee": "^2.3.32",
"react-native-background-geolocation-android": "2.7.1",
"react-native-checkbox": "^1.1.0",
"react-native-code-push": "^1.17.3-beta",
"react-native-device-info": "^0.10.1",
"react-native-fabric": "^0.4.1",
"react-native-file-transfer-android": "0.0.2",
"react-native-image-picker": "^0.26.2",
"react-native-maps": "^0.13.1",
"react-native-message-composer": "^1.0.0",
"react-native-newrelic": "^1.0.18",
"react-native-progress": "^3.2.0",
"react-native-push-notification": "^3.0.0",
"react-native-radio-buttons": "^0.14.0",
"react-native-router-flux": "^3.38.0",
"react-native-slack-webhook": "0.0.5",
"react-native-slider": "^0.9.1",
"react-native-sms-x": "^1.0.4",
"react-native-sound": "^0.9.1",
"react-native-tab-view": "^0.0.69",
"react-native-uploader": "0.0.10",
"react-redux": "^5.0.3",
"react-timer-mixin": "^0.13.3",
"redux": "^3.6.0",
"redux-logger": "^2.10.2",
"redux-persist": "^4.5.0",
"redux-thunk": "^2.2.0",
"socket.io": "^1.7.3"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-jest": "19.0.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-react-native": "1.9.1",
"babel-register": "^6.24.1",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-react": "^7.0.1",
"eslint-plugin-react-native": "^2.3.2",
"flow-bin": "^0.37.0",
"install": "^0.10.1",
"jest": "19.0.2",
"npm": "^4.6.1",
"react-test-renderer": "15.4.2"
},
"jest": {
"preset": "react-native"
}
}
答案 0 :(得分:0)
您是否明确选择react-native-background-geolocation-android
的版本为2.7.1
?
该库上没有版本号为2.7.1
的版本。如果您将其更改为2.7.0
或更新版本的库,然后运行命令yarn add react-native-tab-view
,则会安装它。
您可以找到react-native-background-geolocation-android
here