「npm list -g --depth 0」を実行すると「UNMET PEER DEPENDENCY react@17.0.2」と表示されてしまいます。
パッケージのバージョンの依存関係によるエラーだと思われます。
このエラーによってXcodeからリリースビルドができないためこのエラーを解消したいです。
コマンドラインには下記にように表示されています。
Error
1/Users/UserName/.npm-global/lib 2├── npm@8.1.2 3├── npm-check-updates@11.8.5 4├── UNMET PEER DEPENDENCY react@17.0.2 5├── react-native@0.66.1 6└── react-native-git-upgrade@0.2.7 7 8npm ERR! peer dep missing: react@17.0.2, required by react-native@0.66.1 9npm ERR! peer dep missing: react@^16.8.0 || ^17.0.0, required by use-subscription@1.5.1 10npm ERR! peer dep missing: @babel/preset-env@^7.1.6, required by jscodeshift@0.11.0 11
こちらがpackege.jsonの中身です。
packege.json
1{ 2 "name": "AppName", 3 "version": "0.1.1", 4 "private": true, 5 "scripts": { 6 "android": "react-native run-android", 7 "ios": "react-native run-ios", 8 "start": "react-native start", 9 "test": "jest", 10 "lint": "eslint ." 11 }, 12 "dependencies": { 13 "@codler/react-native-keyboard-aware-scroll-view": "^1.0.1", 14 "@react-native-community/async-storage": "^1.12.0", 15 "@react-native-community/checkbox": "^0.5.0", 16 "@react-native-community/netinfo": "^5.9.7", 17 "@react-navigation/drawer": "^5.9.0", 18 "@react-navigation/native": "^5.7.3", 19 "@react-navigation/stack": "^5.9.0", 20 "axios": "^0.19.2", 21 "moment": "^2.27.0", 22 "moment-timezone": "^0.5.31", 23 "prop-types": "^15.7.2", 24 "react": "17.0.2", 25 "react-native": "0.64.1", 26 "react-native-background-timer": "^2.4.1", 27 "react-native-ble-manager": "^7.5.0", 28 "react-native-ble-plx": "^2.0.2", 29 "react-native-camera": "^3.44.1", 30 "react-native-countdown-circle-timer": "^2.3.10", 31 "react-native-device-info": "^8.1.3", 32 "react-native-firebase": "^5.6.0", 33 "react-native-geolocation-service": "*", 34 "react-native-gesture-handler": "^1.7.0", 35 "react-native-image-base64": "^0.1.4", 36 "react-native-image-crop-picker": "^0.36.2", 37 "react-native-image-resizer": "^1.4.4", 38 "react-native-linear-gradient": "^2.5.6", 39 "react-native-maps": "^0.29.3", 40 "react-native-modal": "^11.10.0", 41 "react-native-permissions": "^3.0.4", 42 "react-native-qrcode-scanner": "^1.5.4", 43 "react-native-reanimated": "^1.10.1", 44 "react-native-safe-area-context": "^3.1.1", 45 "react-native-screens": "^2.9.0", 46 "react-native-splash-screen": "^3.2.0", 47 "react-native-step-indicator": "^1.0.3", 48 "react-native-svg": "^12.1.1", 49 "react-native-tracking-transparency": "^0.1.0", 50 "react-native-version-check": "^3.4.2", 51 "react-native-webview": "^11.6.5", 52 "react-redux": "^7.2.1", 53 "react-redux-multilingual": "^2.0.4", 54 "redux": "^4.0.5", 55 "redux-devtools-extension": "^2.13.8", 56 "redux-thunk": "^2.3.0", 57 "rn-fetch-blob": "^0.12.0" 58 }, 59 "devDependencies": { 60 "@babel/core": "^7.12.9", 61 "@babel/runtime": "^7.12.5", 62 "@react-native-community/eslint-config": "^2.0.0", 63 "babel-jest": "^26.6.3", 64 "eslint": "7.14.0", 65 "jest": "^26.6.3", 66 "metro-react-native-babel-preset": "^0.64.0", 67 "react-test-renderer": "17.0.1" 68 }, 69 "jest": { 70 "preset": "react-native" 71 } 72}
「npm install react@17.0.2」を実行して「node_modules」を削除して「npm install」してみましたが「npm ERR! peer dep missing: react@17.0.2, required by react-native@0.66.1」は解決しませんでした。
その他のエラーも上記と同様の操作をしてもエラーは解決しませんでした。
どうかご教授お願い致します。
環境
MacOS BigSur11.6
Node.js v14.18.1
react-native v0.66.1
Xcode v13.1
npm v6.14.15
回答2件
あなたの回答
tips
プレビュー