Search code examples
capacitorionic5

Unable to update to Capacitor to version 2.1.0


Currently, I am in Capacitor 1.5.2 in my Ionic 5 project. Following is the result of running npx cap doctor

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 2.1.0

  @capacitor/core: 2.1.0

  @capacitor/android: 2.1.0

  @capacitor/ios: 2.1.0

Installed Dependencies:

  @capacitor/cli 1.5.2

  @capacitor/ios 2.1.0

  @capacitor/android 1.5.2

  @capacitor/core 1.5.2

I have followed this document and run all the commands but only the ios got updated with a few audit issues. I have tried multiple times but unable to update cli, core and android. Am I missing anything here?


Solution

  • npm update respects semver, so it will never update to latest Capacitor if you are in v1.

    Instead, use npm install @capacitor/android@latest (replace android with other capacitor package names you want to update)