Я не могу установить новую версию (3.0.7) нативной базы в проекте React Native cli.

avatar
Umesh Bhatia
9 августа 2021 в 04:15
234
0
0

Что я сделал :

  1. Установите пониженную версию исходной базы в версии 3, но не сможете установить эту версию.

  2. Удалите файл кэша npm, а затем снова установите его.

  3. Удалите react-native-safeareaview из папки node-modules.

  4. Мне удается установить пакет версии 2 на основе собственной базы

Код моего файла package.json:

{
  "name": "aflipza",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-navigation/drawer": "^6.1.0",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.0.3",
    "native-base": "^2.13.13",
    "react": "17.0.1",
    "react-native": "0.64.2",
    "react-native-safe-area-context": "^3.3.0",
    "react-native-screens": "^3.5.0",
    "react-native-swiper": "^1.6.0",
    "react-native-vector-icons": "^8.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-test-renderer": "17.0.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Получение этой ошибки

PS D:\Aflipza> npm install native-base react-native-svg styled-components styled-system react-native-safe-area-context
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: aflipza@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ADMIN\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2021-08-09T02_02_32_759Z-debug.log
PS D:\Aflipza> npm install native-base react-native-svg styled-components styled-system react-native-safe-area-context
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: aflipza@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ADMIN\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2021-08-09T02_09_12_800Z-debug.log
PS D:\Aflipza> npm install native-base react-native-svg styled-components styled-system react-native-safe-area-context --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: aflipza@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-dom@17.0.2
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from styled-components@5.3.0
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ADMIN\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!  


 C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2021-08-09T02_09_56_195Z-debug.log
Источник

Ответы (0)