Error When Updating Capacitor

I get the following error when I try to update Capacitor:

npm WARN @capacitor/android@2.2.0 requires a peer of @capacitor/core@~2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @capacitor/ios@2.2.0 requires a peer of @capacitor/core@~2.1.0 but none is installed. You must install peer dependencies yourself.

I have tried:

  • npm install @capacitor/core @capacitor/cli
  • npx npm-check-updates -u followed by npm install

Which both gives the above warning.

Have you checked the output of npx cap doctor ?

I get:

   Capacitor Doctor

Latest Dependencies:

  @capacitor/cli: 2.2.0

  @capacitor/core: 2.2.0

  @capacitor/android: 2.2.0

  @capacitor/electron: 2.2.0

  @capacitor/ios: 2.2.0

Installed Dependencies:


  @capacitor/cli 2.2.0

  @capacitor/core 2.2.0

  @capacitor/android 2.2.0

  @capacitor/electron 2.1.0

  @capacitor/ios 2.2.0

[success] electron looking great! �
[success] Android looking great! �
[error] Xcode is not installed

They are just warnings but have you run'npx cap update ?

I initially got:

√ Updating Android plugins in 10.15ms
  Found 0 Capacitor plugins for android:
√ update android in 98.58ms
√ Updating iOS plugins in 7.57ms
  Found 0 Capacitor plugins for ios:
× Updating iOS native dependencies with "pod install" (may take several minutes):
× update ios:
[error] Error running update: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ffi-1.13.1-x64-mingw32/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'libcurl': The specified module could not be found.\r (LoadError)
.
Could not open library 'libcurl.dll': The specified module could not be found.\r
.
Could not open library 'libcurl.so.4': The specified module could not be found.\r
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.\r
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ffi-1.13.1-x64-mingw32/lib/ffi/library.rb:99:in `map'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ffi-1.13.1-x64-mingw32/lib/ffi/library.rb:99:in `ffi_lib'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curls/settings.rb:7:in `<module:Curl>'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curls/settings.rb:2:in `<module:Ethon>'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curls/settings.rb:1:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curl.rb:27:in `<module:Curl>'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curl.rb:13:in `<module:Ethon>'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon/curl.rb:8:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ethon-0.12.0/lib/ethon.rb:15:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods/sources_manager.rb:5:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods/core_overrides.rb:1:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods.rb:75:in `<module:Pod>'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods.rb:17:in `<top (required)>'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cocoapods-1.9.3/bin/pod:36:in `<top (required)>'
        from C:/Ruby27-x64/bin/pod:23:in `load'
        from C:/Ruby27-x64/bin/pod:23:in `<main>'

√ update electron in 21.00μp
√ update web in 88.00μp
Update finished in 18.379s

After following: https://stackoverflow.com/questions/39377541/how-to-solve-libcurl-not-found-with-rails-on-windows

√ Updating Android plugins in 7.07ms
  Found 0 Capacitor plugins for android:
√ update android in 64.01ms
√ Updating iOS plugins in 30.25ms
  Found 0 Capacitor plugins for ios:
× Updating iOS native dependencies with "pod install" (may take several minutes):
× update ios:
[error] Error running update: Analyzing dependencies
Cloning spec repo `trunk` from `https://cdn.cocoapods.org/`
[!] Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`.
You can try adding it manually in `C:/Users/sirin/.cocoapods/repos` or via `pod repo add`.

√ update electron in 17.80μp
√ update web in 50.40μp
Update finished in 23.69s

Similar issue is reported here without a proper solution: https://stackoverflow.com/questions/60884826/unable-to-add-a-source-with-url-https-cdn-cocoapods-org-named-trunk