Capacitor 3 / can't install Clipboard plugin

I’m trying to install the official Clipboard plugin in my Capacitor 3 app but I get the following error. Any help with this would be very much appreciated.

❯ npm install @capacitor/clipboard                              1 ✘
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @capacitor/core@3.0.0-rc.0
npm ERR! node_modules/@capacitor/core
npm ERR!   peer @capacitor/core@"~3.0.0-rc.0" from @capacitor/android@3.0.0-rc.0
npm ERR!   node_modules/@capacitor/android
npm ERR!     @capacitor/android@"^3.0.0-rc.0" from the root project
npm ERR!   peer @capacitor/core@"3.0.0-rc.0" from @capacitor/device@0.5.6
npm ERR!   node_modules/@capacitor/device
npm ERR!     @capacitor/device@"^0.5.6" from the root project
npm ERR!   4 more (@capacitor/ios, @capacitor/keyboard, @capacitor/share, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @capacitor/clipboard@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @capacitor/core@3.0.0-rc.1
npm ERR! node_modules/@capacitor/core
npm ERR!   peer @capacitor/core@"3.0.0-rc.1" from @capacitor/clipboard@0.4.7
npm ERR!   node_modules/@capacitor/clipboard
npm ERR!     @capacitor/clipboard@"*" 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.

I guess you are using Npm 7? It changes the “conflict” habdling with peer dependencies, read here. Try installing it with --legacy-peer-deps

Many thanks! Yes, I am using npm 7 and --legacy-peer-deps did the trick in terms of installing Clipboard plugin. Also, I’m glad to have learnt about the changes in npm 7, so thanks for the link.

However, I now have a new problem which I assume must be related. When I try to build my project (Vue + Capacitor) I now get an error relating to the in-app-purchase-2 Ionic Native wrapper I’m using. This was previously building fine and didn’t require @ionic-native/core. I’m reluctant to install @ionic-native/core as it wasn’t necessary before. The only change I’ve made, other than installing the Clipboard plugin, was to update npm to v7.11.2. Could that have caused the problem?

> vue-cli-service build


⠏  Building for production...

 ERROR  Failed to compile with 1 error                                                                         09:55:53

This dependency was not found:

* @ionic-native/core in ./node_modules/@ionic-native/in-app-purchase-2/index.js

To install it, you can run: npm install --save @ionic-native/core
 ERROR  Build failed with errors.

Unsure about what Change caused this, but i also faced that and had to install it manually :blush:

Done and all seems fine. Doesn’t appear to be a large dependency. Thanks again for your help :relaxed:

latest clipboard plugin requires capacitor rc.1, which was released a few minutes before the plugins