当我尝试安装react-navigation-bar时出现警告和错误

时间:2020-10-25 19:13:50

标签: javascript reactjs react-native navigation warnings

我尝试将我的应用添加到导航栏。我需要安装这个react-native-bar

我在控制台上写道:

npm install react-native-navigation-bar --save

这是结果:

npm WARN @react-navigation/bottom-tabs@5.10.0 requires a peer of @react-navigation/native@^5.0.5 but none is installed. You must install peer dependencies yourself.
npm WARN @react-navigation/bottom-tabs@5.10.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN @react-navigation/bottom-tabs@5.10.0 requires a peer of react-native-safe-area-context@>= 0.6.0 but none is installed. You must install peer dependencies yourself.     
npm WARN @react-navigation/bottom-tabs@5.10.0 requires a peer of react-native-screens@>= 2.0.0-alpha.0 || >= 2.0.0-beta.0 || >= 2.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-iphone-x-helper@1.3.0 requires a peer of react-native@>=0.42.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\atalay\octobil_react\node_modules\react-native-navigation-bar
npm ERR! dest C:\Users\atalay\octobil_react\node_modules\.react-native-navigation-bar.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\atalay\octobil_react\node_modules\react-native-navigation-bar' -> 'C:\Users\atalay\octobil_react\node_modules\.react-native-navigation-bar.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\atalay\AppData\Roaming\npm-cache\_logs\2020-10-25T18_59_31_615Z-debug.log

C:\Users\atalay\octobil_react>npm install react-native-navigation-bar@^5.0.5 --save
npm ERR! code ETARGET
npm ERR! notarget No matching version found for react-native-navigation-bar@5.0.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\atalay\AppData\Roaming\npm-cache\_logs\2020-10-25T19_06_50_941Z-debug.log

enter image description here

Packages.json:

"dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/bottom-tabs": "^5.10.0",
    "@react-navigation/native": "^5.8.0",
    "@react-navigation/stack": "^5.10.0",
    "@testing-library/jest-dom": "^5.11.5",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "navigationbar-react-native": "0.0.5",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-native": "^0.63.3",
    "react-native-gesture-handler": "^1.8.0",
    "react-native-navigation-bar": "^0.2.1",
    "react-native-reanimated": "^1.13.1",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screens": "^2.11.0",
    "react-navigation": "^4.4.2",
    "react-navigation-stack": "^2.8.4",
    "react-scripts": "4.0.0",
    "typescript": "^4.0.3",
    "web-vitals": "^0.2.4"
  },

看起来还可以,但编译失败

1 个答案:

答案 0 :(得分:1)

此软件包依赖于其他几个软件包,只需先使用npm安装这些软件包,

npm i @react-navigation/native react-native react-native-safe-area-context react-native-screens typescript