Home > Blockchain >  Cannot find module '@ionic/cordova-builders/package.json' at build
Cannot find module '@ionic/cordova-builders/package.json' at build

Time:01-05

Getting this error while building apk

An unhandled exception occurred: Cannot find module '@ionic/cordova-builders/package.json'

Can anyone help me what's the issue

Ionic Info

Ionic:

Ionic CLI : 5.4.16 (C:\Users\anshi\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 5.9.4 @angular-devkit/build-angular : 12.1.4 @angular-devkit/schematics : 12.2.18 @angular/cli : 12.2.18 @ionic/angular-toolkit : 4.0.0

Cordova:

Cordova CLI : 11.0.0 Cordova Platforms : android 11.0.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 23 other plugins)

Utility:

cordova-res : 0.15.4 native-run (update available: 1.7.1) : 1.5.0

System:

Android SDK Tools : 26.1.1 (C:\Users\username\AppData\Local\Android\Sdk) NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe) npm : 6.14.18 OS : Windows 10

CodePudding user response:

Install module

npm i @ionic/cordova-builders

CodePudding user response:

Is the file present in your node_modules? node_modules/@ionic/cordova-builders/package.json

have you added the builders with: ng add @ionic/cordova-builders as per docs? https://www.npmjs.com/package/@ionic/cordova-builders

I don't think this is related to your issue. But the newest version of build tools is 33. cordova-android 11 builds by default for target-SDK-32 I believe. build-tools 26 is for targetSDK-26. I think you should add the newer versions of build tools (or use a lower version of cordova-android)

  • Related