Forcing npm install?

What platform are you building for?

Android

What framework are you building with?

Capacitor

What is your build ID?

dc58a09a-029a-4829-8321-271e0d4998f0

What is your error message?

ServerError: Capacitor dependency install failed
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @capacitor/google-maps@7.2.0
npm error Found: @capacitor/core@8.0.0-beta.0
npm error node_modules/@capacitor/core
npm error @capacitor/core@“8.0.0-beta.0” from the root project
npm error peer @capacitor/core@“^8.0.0-beta.0” from @capacitor/android@8.0.0-beta.0
npm error node_modules/@capacitor/android
npm error @capacitor/android@“8.0.0-beta.0” from the root project
npm error 3 more (@capacitor/app, @capacitor/ios, @capacitor/status-bar)
npm error
npm error Could not resolve dependency:
npm error peer @capacitor/core@“>=7.0.0” from @capacitor/google-maps@7.2.0
npm error node_modules/@capacitor/google-maps
npm error @capacitor/google-maps@“7.2.0” from the root project
npm error
npm error Conflicting peer dependency: @capacitor/core@7.4.4
npm error node_modules/@capacitor/core
npm error peer @capacitor/core@“>=7.0.0” from @capacitor/google-maps@7.2.0
npm error node_modules/@capacitor/google-maps
npm error @capacitor/google-maps@“7.2.0” from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Please describe the issue:

Hello,

I’m trying to test an app using the new beta version of Capacitor (v8). However, I need to run npm install with the --force flag because some of my dependencies haven’t been updated for Capacitor 8 yet, since it’s not officially released.

How can I make the build process run npm install with the --force flag?

Thank you!

Are you certain --force is what you need. The official docs state this:

The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.

I have to admit there’s some mixed information out there about what --force does, so this might be incorrect.

We do support --legacy-peer-deps which generally does solve this issue. You can enable by that including the following in your voltbuilder.json:

"capacitor": {
    "installLegacyPeerDeps": true
}

If this doesn’t work for you, I can add an option to pass the force flag.