相关文章推荐

Hello,

I encounter issues when I try to install or uninstall a package using NPM.

For example, when I launch the command npm uninstall @awesome-cordova-plugins/barcode-scanner , I get the kind of warning/errors indicated in the list below.

I am not sure to know the better way to correctly fix this problem. Could someone help me with this?

Thanks for your help,

The errors:

npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @awesome-cordova-plugins/[email protected] npm WARN Found: @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/core npm WARN peer @awesome-cordova-plugins/core@"^6.0.1" from @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/camera npm WARN @awesome-cordova-plugins/camera@"^6.2.0" from the root project npm WARN 2 more (@awesome-cordova-plugins/device-orientation, the root project) npm WARN npm WARN Could not resolve dependency: npm WARN peer @awesome-cordova-plugins/core@"^5.1.0" from @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/barcode-scanner npm WARN npm WARN Conflicting peer dependency: @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/core npm WARN peer @awesome-cordova-plugins/core@"^5.1.0" from @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/barcode-scanner npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @awesome-cordova-plugins/[email protected] npm WARN Found: [email protected] npm WARN node_modules/rxjs npm WARN rxjs@"6.6.7" from @angular-devkit/[email protected] npm WARN node_modules/@angular-devkit/architect npm WARN dev @angular-devkit/architect@"^0.1202.13" from the root project npm WARN 48 more (@angular-devkit/core, @angular-devkit/build-angular, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer rxjs@"^5.5.0 || ^7.3.0" from @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/barcode-scanner npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/rxjs npm WARN peer rxjs@"^5.5.0 || ^7.3.0" from @awesome-cordova-plugins/[email protected] npm WARN node_modules/@awesome-cordova-plugins/barcode-scanner npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @ngrx/[email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/core npm ERR! peer @angular/core@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/animations npm ERR! peerOptional @angular/animations@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/platform-browser npm ERR! peer @angular/platform-browser@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/forms npm ERR! peer @angular/forms@">=8.2.7" from @ionic/[email protected] npm ERR! node_modules/@ionic/angular npm ERR! 1 more (the root project) npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project) npm ERR! @angular/animations@"^12.2.14" from the root project npm ERR! peer @angular/core@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/common npm ERR! peer @angular/common@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/forms npm ERR! peer @angular/forms@">=8.2.7" from @ionic/[email protected] npm ERR! node_modules/@ionic/angular npm ERR! @ionic/angular@"^5.9.1" from the root project npm ERR! 1 more (the root project) npm ERR! peer @angular/common@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/platform-browser npm ERR! peer @angular/platform-browser@"12.2.14" from @angular/[email protected] npm ERR! node_modules/@angular/forms npm ERR! peer @angular/forms@">=8.2.7" from @ionic/[email protected] npm ERR! node_modules/@ionic/angular npm ERR! 1 more (the root project) npm ERR! 3 more (@angular/platform-browser-dynamic, @angular/router, the root project) npm ERR! 6 more (@angular/platform-browser-dynamic, @angular/router, ...) npm ERR! 9 more (@angular/forms, @angular/platform-browser, ...)

All the @awesome-cordova-plugins package versions should match, looks like you have 6.x on some of them but you are trying to install @awesome-cordova-plugins /barcode-scanner 5.x.
Try installing latest @awesome-cordova-plugins /barcode-scanner.

An alternative is to install with --force param so it ignores peer dependency problems, but could cause other issues.

Hello @julio-ionic ,

Thanks for your reply!

I actually try to build a new version of my app in Android Studio but I need to use the compileSdkVersion 31 instead of 30.

With the version 30, it works fine but with the version 31, I get a build erreur with the manifest file of the package “capacitor-cordova-android-plugins”. The only library used with this package is the “barcodescanner”.

I have seen that the package “phonegap-plugin-barcodescanner” was archived and so, I suppose I have to switch to another tool and delete this one.

I just tried to update to the latest version of this package but the error is still presents when I try to build in Android Studio :confused:

@awesome-cordova-plugins packages are just wrappers around existing cordova plugins with types for easier use in Angular projects, so always install latest version of them or the version you need to match other @awesome-cordova-plugins packages you have installed. The @awesome-cordova-plugins versions are independent from the actual cordova plugins they wrap.

Your problem is with phonegap-plugin-barcodescanner ( GitHub - phonegap/phonegap-plugin-barcodescanner: cross-platform BarcodeScanner for Cordova / PhoneGap ).
As you said, it’s archived, and latest release was 4 years ago, so it doesn’t support SDK 31+ because it didn’t exist when the latest release was done and it requires changes to support it.

@ionic-native is just the previous name of @awesome-cordova-plugins , still a plugin wrapper, and installing that will probably conflict with the @awesome-cordova-plugins .

By checking the phonegap-barcodescanner network tab on GitHub you can see forks and when they were updated
this one was updated today changing the compile to implementation , which is one of the problems that need to be solved, in this case to work with gradle 7

 
推荐文章