5
votes

I created an empty blank ionic app (without capacitor), added the cordova plugin and install the google-plus package.

In the devDependecies section of the packages.json I have:

"@angular-devkit/build-angular": "^0.1100.1",
"@angular-devkit/core": "^11.0.1",
"@angular/cli": "~10.0.5",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/language-service": "~10.0.0",

I proceeded in building the app by doing:

ionic cordova build android --prod --release --verbose

But I get the exception:

An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils' Require stack: C:\dev\myapp\node_modules@ionic\angular-toolkit\builders\utils\index.js C:\dev\myapp\node_modules@ionic\angular-toolkit\builders\cordova-build\index.js C:\dev\myapp\node_modules@angular-devkit\architect\node\node-modules-architect-host.js C:\dev\myapp\node_modules@angular-devkit\architect\node\index.js C:\dev\myapp\node_modules@angular\cli\models\architect-command.js C:\dev\myapp\node_modules@angular\cli\commands\run-impl.js C:\dev\myapp\node_modules@angular-devkit\schematics\tools\export-ref.js C:\dev\myapp\node_modules@angular-devkit\schematics\tools\index.js C:\dev\myapp\node_modules@angular\cli\utilities\json-schema.js C:\dev\myapp\node_modules@angular\cli\models\command-runner.js C:\dev\myapp\node_modules@angular\cli\lib\cli\index.js C:\dev\myapp\node_modules@angular\cli\lib\init.js C:\dev\myapp\node_modules@angular\cli\bin\ng See "C:\Users\xyz\AppData\Local\Temp\ng-EHBnHs\angular-errors.log" for further details. [ERROR] An error occurred while running subprocess ng.

I've tried various SO answers like cleaning the cache, updating, re-installing, etc... but I still get this error:

Here the ionic info: enter image description here

Any way to get this error fixed?

3
@MansourAlnasser I tried most of the answers suggested there. Nothing worked.Ivan-Mark Debono
check the folder node_modules can you find a @angular-devkit/build-angular ?Mansour Alnasser
also share ionic infoMansour Alnasser
@MansourAlnasser Yes @angular-devkit/build-angular is there but there is no angular-cli-files folder under src.Ivan-Mark Debono

3 Answers

9
votes

Change devDependencies to "@angular-devkit/build-angular": "~0.1000.0", remove folder node_module folder and run npm i.

1
votes

I had the same issue after changing system, It can happen while migrating from one version to another.

  1. npm i @ionic/angular-toolkit@latest .

Try this it may work for you as well.

0
votes

had the same problem what fix it

1- npm uninstall -g @ionic/cli

2- npm install -g @ionic/[email protected]

3- make a new project in a new folder

4- ionic start

Note: Don't run "npm audit fix"

5- ionic Cordova build android I hope it works with all