Refusing to run ionic cordova plugin inside a Capacitor project

I have a cordova app which I recently updated. Now when I try and add plugins I get this message. Ionic info output is

[WARN] Error loading @capacitor/core package.json: Error: Cannot find module '@capacitor/core/package'
       
       Require stack:
       - /usr/local/lib/node_modules/@ionic/cli/lib/project/index.js
       - /usr/local/lib/node_modules/@ionic/cli/lib/index.js
       - /usr/local/lib/node_modules/@ionic/cli/index.js
       - /usr/local/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

   Ionic CLI                     : 6.12.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.4.0
   @angular-devkit/build-angular : 0.901.12
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 9.1.12
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : not installed
   @capacitor/core : not installed

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : ios 6.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 13 other plugins)

Utility:

   cordova-res (update available: 0.15.1) : 0.10.0
   native-run                             : not installed

System:

   ios-deploy : 1.10.0
   ios-sim    : 8.0.2
   NodeJS     : v13.11.0 (/usr/local/Cellar/node/13.11.0/bin/node)
   npm        : 6.14.5
   OS         : macOS Catalina
   Xcode      : Xcode 12.0.1 Build version 12A7300

What has gone wrong?

Iā€™m experiencing the same problem, did you find any solution?

Do you have a capacitor.config.json file in your project directory? If so, remove it.

Try this command

ionic integrations disable capacitor

3 Likes