Recently, I made the transition in my ionic 4 project to utilize angular 7. While everything seems to be functioning correctly in debug mode, I encountered an issue when attempting to compile for production using the command 'ionic cordova build android --prod'. The output I received was as follows:
ionic-app-scripts build --prod --target cordova --platform android [20:24:15] ionic-app-scripts 3.2.4 ... [20:24:44] typescript error Cannot find type definition file for '@types'.
[20:24:44] ionic-app-script task: "build" [20:24:44] Error: Failed to transpile TypeScript Error: Failed to transpile TypeScript at errorCheckProgram (/Users/jesusotero/Projects/Bambuco/confiar/mardeconfianza/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:119:39) at Object. (/Users/jesusotero/Projects/Bambuco/confiar/mardeconfianza/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:89:21) at step (/Users/jesusotero/Projects/Bambuco/confiar/mardeconfianza/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23) at Object.next (/Users/jesusotero/Projects/Bambuco/confiar/mardeconfianza/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53) at fulfilled (/Users/jesusotero/Projects/Bambuco/confiar/mardeconfianza/app/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58) [ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --prod --target cordova --platform android exited with exit code 1.
I have searched extensively for a solution to this problem but have not found one that works. If anyone has any guidance on how to resolve this issue, it would be greatly appreciated. Below is a snippet from my package.json for reference:
{
"name": "xxxxxxx",
"version": "1.0.2",
... // (Snippet continues, maintaining original content)
For further context, here is some information about my Ionic setup:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.6
@ionic/app-scripts : 3.2.4
... // (Information continues, keeping original details)
System:
NodeJS : v10.11.0 (/usr/local/Cellar/node/10.11.0/bin/node)
npm : 6.9.0
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001