Unable to resolve dependency

when i build the app with ( npm install @capacitor/android)
i hove this error :
code ERESOLVE

npm ERR! ERESOLVE unable to resolve dependency tree

npm ERR!

npm ERR! While resolving: beedelivery@0.0.1

npm ERR! Found: @capacitor/core@5.2.3

npm ERR! node_modules/@capacitor/core

npm ERR! @capacitor/core@“5.2.3” from the root project

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer @capacitor/core@“^5.4.0” from @capacitor/android@5.4.1

npm ERR! node_modules/@capacitor/android

npm ERR! @capacitor/android@“^5.4.1” from the root project

npm ERR!
: my json (backage.json) is

“dependencies”: {
@angular/animations”: “^16.0.0”,
@angular/common”: “^16.0.0”,
@angular/compiler”: “^16.0.0”,
@angular/core”: “^16.0.0”,
@angular/fire”: “^7.6.1”,
@angular/forms”: “^16.0.0”,
@angular/platform-browser”: “^16.2.2”,
@angular/platform-browser-dynamic”: “^16.0.0”,
@angular/router”: “^16.0.0”,
@capacitor/android”: “^5.4.1”,
@capacitor/app”: “5.0.6”,
@capacitor/camera”: “^5.0.6”,
@capacitor/core”: “5.2.3”,
@capacitor/haptics”: “5.0.6”,
@capacitor/keyboard”: “5.0.6”,
@capacitor/splash-screen”: “^5.0.6”,
@capacitor/status-bar”: “5.0.6”,
@ionic-native/firebase”: “^5.36.0”,
@ionic/angular”: “^7.0.0”,
@ionic/pwa-elements”: “^3.2.1”,
“capacitor-screenshot”: “^5.0.0”,
“ionicons”: “^7.0.0”,
“rxjs”: “~7.8.0”,
“tslib”: “^2.3.0”,
“zone.js”: “~0.13.0”
},
“devDependencies”: {
@angular-devkit/build-angular”: “^16.0.0”,
@angular-eslint/builder”: “^16.0.0”,
@angular-eslint/eslint-plugin”: “^16.0.0”,
@angular-eslint/eslint-plugin-template”: “^16.0.0”,
@angular-eslint/schematics”: “^16.0.0”,
@angular-eslint/template-parser”: “^16.0.0”,
@angular/cli”: “^16.0.0”,
@angular/compiler”: “^16.0.0”,
@angular/compiler-cli”: “^16.0.0”,
@angular/language-service”: “^16.0.0”,
@capacitor/assets”: “^3.0.0”,
@capacitor/cli”: “5.2.3”,
@ionic/angular-toolkit”: “^9.0.0”,
@types/jasmine”: “~4.3.0”,
@types/node”: “^12.11.1”,
@typescript-eslint/eslint-plugin”: “5.3.0”,
@typescript-eslint/parser”: “5.3.0”,
“eslint”: “^7.26.0”,
“eslint-plugin-import”: “2.22.1”,
“eslint-plugin-jsdoc”: “30.7.6”,
“eslint-plugin-prefer-arrow”: “1.2.2”,
“firebase”: “^9.23.0”,
“jasmine-core”: “~4.6.0”,
“jasmine-spec-reporter”: “~5.0.0”,
“karma”: “~6.4.0”,
“karma-chrome-launcher”: “~3.2.0”,
“karma-coverage”: “~2.2.0”,
“karma-coverage-istanbul-reporter”: “~3.0.2”,
“karma-jasmine”: “~5.1.0”,
“karma-jasmine-html-reporter”: “~2.0.0”,
“ts-node”: “^8.3.0”,
“typescript”: “~5.0.2”
},

Some of your packages are installed with ^, which will install the latest minor version avaiable, and others with a exact version. Install all the capacitor related ones with ^ so it uses latest minor for all.

You have @capacitor/android 5.4.1, which requires @capacitor/core 5.4.0 or newer, but you have @capacitor/core 5.2.3 installed.

1 Like

thank @julio-ionic for your solution