Unable to install @capacitor/background-runner

I started with a fresh project and can’t install @capacitor/background-runner
In Vs Code with the Ionic plugin, i made a new tabs project with Vue. And run following command in the terminal

npm install @capacitor/background-runner

Apparently Capacitor was upgraded to version number 6. And i was trying to install @capacitor/background-runner and i run into an install error.

\Ionic\beep>npm install @capacitor/background-runner
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: beep@0.0.1
npm ERR! Found: @capacitor/core@6.0.0
npm ERR! node_modules/@capacitor/core
npm ERR!   @capacitor/core@"6.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @capacitor/core@"^5.0.0" from @capacitor/background-runner@1.1.0
npm ERR! node_modules/@capacitor/background-runner
npm ERR!   @capacitor/background-runner@"*" 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.

How do i install background-runner now ? if anyone could help that would be great !
Thank you in advance !

It would seem the Capacitor team missed updating this plugin to support Capacitor 6 as it does require "@capacitor/core": "^5.0.0" .

I would open an issue on the repo.

In the meantime, you could downgrade to Capacitor 5.

1 Like

As stated in the error message, try this as workaround:

npm install @capacitor/background-runner --legacy-peer-deps