我运行npm install
来更新我的react本机cli应用程序的package.json
中的依赖项,但是这对我没有用,我还运行了npm aduit fix
或npm audit fix --force
。
我还尝试移除node_modules
文件夹,并再次运行npm install
,但与以前的依赖项相同。
我检查最新的依赖项来运行npm outdated
,结果是
@invertase/react-native-apple-authentication 1.1.2 1.1.2 2.1.5 node_modules/@invertase/react-native-apple-authentication ReactNativeMultiVendor
@react-native-community/checkbox 0.5.2 0.5.12 0.5.12 node_modules/@react-native-community/checkbox ReactNativeMultiVendor
@react-native-firebase/app 10.8.1 10.8.1 14.5.1 node_modules/@react-native-firebase/app ReactNativeMultiVendor
@react-native-firebase/auth 10.8.1 10.8.1 14.5.1 node_modules/@react-native-firebase/auth ReactNativeMultiVendor
@react-native-firebase/messaging 10.8.1 10.8.1 14.5.1 node_modules/@react-native-firebase/messaging ReactNativeMultiVendor
@react-navigation/bottom-tabs 5.11.15 5.11.15 6.2.0 node_modules/@react-navigation/bottom-tabs ReactNativeMultiVendor
@react-navigation/drawer 5.12.9 5.12.9 6.3.1 node_modules/@react-navigation/drawer ReactNativeMultiVendor
@react-navigation/native 5.9.8 5.9.8 6.0.8 node_modules/@react-navigation/native ReactNativeMultiVendor
@react-navigation/stack 5.14.9 5.14.9 6.1.1 node_modules/@react-navigation/stack ReactNativeMultiVendor
babel-jest 25.5.1 25.5.1 27.5.1 node_modules/babel-jest ReactNativeMultiVendor
babel-preset-react-native 2.1.0 2.1.0 4.0.1 node_modules/babel-preset-react-native ReactNativeMultiVendor
base-64 0.1.0 0.1.0 1.0.0 node_modules/base-64 ReactNativeMultiVendor
crypto-js 3.3.0 3.3.0 4.1.1 node_modules/crypto-js ReactNativeMultiVendor
eslint-config-prettier 4.3.0 4.3.0 8.5.0 node_modules/eslint-config-prettier ReactNativeMultiVendor
eslint-plugin-prettier 3.4.1 3.4.1 4.0.0 node_modules/eslint-plugin-prettier ReactNativeMultiVendor
expo-av 8.7.0 8.7.0 10.2.1 node_modules/expo-av ReactNativeMultiVendor
expo-blur 8.2.2 8.2.2 11.0.0 node_modules/expo-blur ReactNativeMultiVendor
expo-facebook 8.2.1 8.2.1 12.1.1 node_modules/expo-facebook ReactNativeMultiVendor
expo-file-system 9.3.0 9.3.0 13.1.4 node_modules/expo-file-system ReactNativeMultiVendor
expo-firebase-recaptcha 1.4.4 1.4.4 2.1.0 node_modules/expo-firebase-recaptcha ReactNativeMultiVendor
expo-image-picker 8.4.0 8.4.0 12.0.2 node_modules/expo-image-picker ReactNativeMultiVendor
expo-localization 8.2.1 8.2.1 12.0.1 node_modules/expo-localization ReactNativeMultiVendor
expo-location 8.3.0 8.3.0 14.0.2 node_modules/expo-location ReactNativeMultiVendor
expo-permissions 9.1.0 9.1.0 13.1.1 node_modules/expo-permissions ReactNativeMultiVendor
firebase 8.10.1 8.10.1 9.6.8 node_modules/firebase ReactNativeMultiVendor
metro-react-native-babel-preset 0.59.0 0.59.0 0.69.0 node_modules/metro-react-native-babel-preset ReactNativeMultiVendor
react 16.13.1 16.13.1 17.0.2 node_modules/react ReactNativeMultiVendor
react-native 0.61.4 0.61.5 0.67.3 node_modules/react-native ReactNativeMultiVendor
react-native-appearance 0.0.0 0.0.0 0.3.4 node_modules/react-native-appearance ReactNativeMultiVendor
react-native-confirmation-code-field 6.7.0 6.7.0 7.3.0 node_modules/react-native-confirmation-code-field ReactNativeMultiVendor
react-native-device-info 5.6.5 5.6.5 8.5.0 node_modules/react-native-device-info ReactNativeMultiVendor
react-native-elements 2.3.2 2.3.2 3.4.2 node_modules/react-native-elements ReactNativeMultiVendor
react-native-fbsdk 1.1.2 1.1.2 3.0.0 node_modules/react-native-fbsdk ReactNativeMultiVendor
react-native-geocoding 0.4.0 0.4.0 0.5.0 node_modules/react-native-geocoding ReactNativeMultiVendor
react-native-gesture-handler 1.10.3 1.10.3 2.3.1 node_modules/react-native-gesture-handler ReactNativeMultiVendor
react-native-iap 7.5.6 7.5.6 8.0.5 node_modules/react-native-iap ReactNativeMultiVendor
react-native-image-crop-picker 0.33.4 0.33.4 0.37.3 node_modules/react-native-image-crop-picker ReactNativeMultiVendor
react-native-localize 1.4.3 1.4.3 2.2.0 node_modules/react-native-localize ReactNativeMultiVendor
react-native-maps 0.27.1 0.27.1 0.30.1 node_modules/react-native-maps ReactNativeMultiVendor
react-native-modal 11.10.0 11.10.0 13.0.1 node_modules/react-native-modal ReactNativeMultiVendor
react-native-phone-input 0.2.4 0.2.4 1.3.2 node_modules/react-native-phone-input ReactNativeMultiVendor
react-native-progress 4.1.2 4.1.2 5.0.0 node_modules/react-native-progress ReactNativeMultiVendor
react-native-ratings 7.6.1 7.6.1 8.1.0 node_modules/react-native-ratings ReactNativeMultiVendor
react-native-safe-area-context 3.4.1 3.4.1 4.1.2 node_modules/react-native-safe-area-context ReactNativeMultiVendor
react-native-screens 2.18.1 2.18.1 3.13.1 node_modules/react-native-screens ReactNativeMultiVendor
react-native-search-box 0.0.19 0.0.19 0.0.20 node_modules/react-native-search-box ReactNativeMultiVendor
react-native-snap-carousel 1.3.1 1.6.1 3.9.1 node_modules/react-native-snap-carousel ReactNativeMultiVendor
react-native-ui-lib 5.4.2 5.30.2 6.11.0 node_modules/react-native-ui-lib ReactNativeMultiVendor
react-native-vector-icons 7.0.0 7.0.0 9.1.0 node_modules/react-native-vector-icons ReactNativeMultiVendor
react-test-renderer 16.13.1 16.13.1 17.0.2 node_modules/react-test-renderer ReactNativeMultiVendor
remote-redux-devtools 0.5.14 0.5.16 0.5.16 node_modules/remote-redux-devtools ReactNativeMultiVendor
uuidv4 5.0.1 5.0.1 6.2.12 node_modules/uuidv4 ReactNativeMultiVendor
yup 0.28.5 0.28.5 0.32.11 node_modules/yup ReactNativeMultiVendor
对于更新依赖项,我运行npm update
,并看到以下错误
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: JaffEx@1.0.0
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR! react@"16.13.1" from the root project
npm ERR! peer react@"*" from @react-native-community/art@1.2.0
npm ERR! node_modules/@react-native-community/art
npm ERR! @react-native-community/art@"^1.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.9.0" from react-native@0.61.5
npm ERR! node_modules/react-native
npm ERR! react-native@"^0.61.4" from the root project
npm ERR! peer react-native@"*" from @react-native-community/art@1.2.0
npm ERR! node_modules/@react-native-community/art
npm ERR! @react-native-community/art@"^1.2.0" 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\Dell\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\Dell\AppData\Local\npm-cache\_logs\2022-03-10T09_44_11_332Z-debug-0.log
我试着运行npm update -force
,它向我展示了很多警告和错误--你可以看到
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @react-native-community/checkbox@0.5.12
npm WARN Found: react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-native@">= 0.62" from @react-native-community/checkbox@0.5.12
npm WARN node_modules/@react-native-community/checkbox
npm WARN @react-native-community/checkbox@"^0.5.2" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-native@0.67.3
npm WARN node_modules/react-native
npm WARN peer react-native@">= 0.62" from @react-native-community/checkbox@0.5.12
npm WARN node_modules/@react-native-community/checkbox
npm WARN @react-native-community/checkbox@"^0.5.2" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native@0.61.5
npm WARN Found: react@16.13.1
npm WARN node_modules/react
npm WARN peer react@"16.11.0" from react-native-windows@0.62.22
npm WARN node_modules/@react-native-community/datetimepicker/node_modules/react-native-windows
npm WARN optional react-native-windows@"^0.62.0-0" from @react-native-community/datetimepicker@2.6.2
npm WARN node_modules/@react-native-community/datetimepicker
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"16.9.0" from react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN
npm WARN Conflicting peer dependency: react@16.9.0
npm WARN node_modules/react
npm WARN peer react@"16.9.0" from react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native-loader-overlay@1.0.0
npm WARN Found: react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-native@"^0.50.0" from react-native-loader-overlay@1.0.0
npm WARN node_modules/react-native-loader-overlay
npm WARN react-native-loader-overlay@"^1.0.0" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-native@0.50.4
npm WARN node_modules/react-native
npm WARN peer react-native@"^0.50.0" from react-native-loader-overlay@1.0.0
npm WARN node_modules/react-native-loader-overlay
npm WARN react-native-loader-overlay@"^1.0.0" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native-modal-patch@0.61.0
npm WARN Found: react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-native@"^0.60.0" from react-native-modal-patch@0.61.0
npm WARN node_modules/react-native-modal-patch
npm WARN react-native-modal-patch@"https://github.com/HarvestProfit/react-native-modal-patch.git" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-native@0.60.6
npm WARN node_modules/react-native
npm WARN peer react-native@"^0.60.0" from react-native-modal-patch@0.61.0
npm WARN node_modules/react-native-modal-patch
npm WARN react-native-modal-patch@"https://github.com/HarvestProfit/react-native-modal-patch.git" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native-ui-lib@5.30.2
npm WARN Found: react@16.13.1
npm WARN node_modules/react
npm WARN peer react@"16.11.0" from react-native-windows@0.62.22
npm WARN node_modules/@react-native-community/datetimepicker/node_modules/react-native-windows
npm WARN optional react-native-windows@"^0.62.0-0" from @react-native-community/datetimepicker@2.6.2
npm WARN node_modules/@react-native-community/datetimepicker
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@">=17.0.1" from react-native-ui-lib@5.30.2
npm WARN node_modules/react-native-ui-lib
npm WARN react-native-ui-lib@"^5.4.2" from the root project
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN peer react@">=17.0.1" from react-native-ui-lib@5.30.2
npm WARN node_modules/react-native-ui-lib
npm WARN react-native-ui-lib@"^5.4.2" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native-ui-lib@5.30.2
npm WARN Found: react-native@0.61.5
npm WARN node_modules/react-native
npm WARN react-native@"^0.61.4" from the root project
npm WARN 49 more (@react-native-community/art, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-native@">=0.64.1" from react-native-ui-lib@5.30.2
npm WARN node_modules/react-native-ui-lib
npm WARN react-native-ui-lib@"^5.4.2" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-native@0.67.3
npm WARN node_modules/react-native
npm WARN peer react-native@">=0.64.1" from react-native-ui-lib@5.30.2
npm WARN node_modules/react-native-ui-lib
npm WARN react-native-ui-lib@"^5.4.2" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated redux-devtools-core@0.2.1: Package moved to @redux-devtools/app.
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
added 189 packages, removed 173 packages, changed 52 packages, and audited 2252 packages in 3m
105 packages are looking for funding
run `npm fund` for details
39 vulnerabilities (4 low, 29 moderate, 6 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
在收到这些消息后,我运行npm audit fix
或npm audit fix --force
,但是没有任何改变,它显示了与上面看到的相同的错误。
如果我采用错误的方法,请纠正我,我想将所有依赖项更新到它的最新版本
发布于 2022-03-10 10:54:55
在npm install
之后,还使用npm update
将依赖项升级到更高的稳定版本。如果你愿意的话,你可以使用npm aduit fix
。
发布于 2022-03-10 10:51:30
尝试在全球范围内安装npm-检查更新(https://www.npmjs.com/package/npm-check-updates)。安装此模块后,您可以运行ncu -u
在package.json中更新版本,然后使用npm install
更新版本将被安装。
发布于 2022-03-13 11:41:36
请检查文件夹结构是否是您在正确文件夹中安装的节点模块。
,否则尝试:
https://stackoverflow.com/questions/71422801
复制相似问题