我運行npm install以更新package.json我的 react-native cli 應用程式的依賴項,但這對我不起作用我也運行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 fixornpm audit fix --force但沒有任何改變,它顯示了與您在上面看到的相同的錯誤
請糾正我如果我遵循錯誤的方法,我想將所有依賴項更新到最新版本
uj5u.com熱心網友回復:
之后npm install
還用于npm update將依賴項升級到更高的穩定版本。然后,如果您愿意,可以使用npm aduit fix.
uj5u.com熱心網友回復:
嘗試全域安裝 npm-check-updates ( https://www.npmjs.com/package/npm-check-updates )。安裝此模塊后,您可以運行ncu -u以更新 package.json 中的版本,然后npm install將安裝更新的版本。
uj5u.com熱心網友回復:
請檢查檔案夾結構是否在正確的檔案夾中安裝節點模塊。
否則嘗試:
您需要先使用 npm install -g react-native-cli 安裝 react-native-cli。然后嘗試 npm 安裝。
洗掉 package-lock.json 檔案和節點模塊檔案夾,然后 npm install。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/443041.html
標籤:javascript 节点.js 反应式 npm
