Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic app: an unhandled exception occurred: Could not find module “@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils”

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?

like image 656
Ivan-Mark Debono Avatar asked Nov 17 '20 08:11

Ivan-Mark Debono


1 Answers

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

like image 90
gvox Avatar answered Oct 13 '22 03:10

gvox