ionic-app-script在构建时失败 - 无法找到模块'@ angular / compiler-cli / ngtools2'

知识就是力量,时间就是生命。这篇文章主要讲述ionic-app-script在构建时失败 - 无法找到模块' @ angular / compiler-cli / ngtools2' 相关的知识,希望能为你提供帮助。
只有当我正在构建我的应用程序到生产时,我在Cannot find module '@angular/compiler-cli/ngtools2'build步骤中得到了错误ionic-app-script,在ionic cordova run android --prod之后
我在我的package.json文件中依赖"@angular/compiler-cli": "^7.2.4",并查看我的node_modules文件夹我可以看到@angular/compiler-cli/ngtools2.js
为什么ionic-app-script找不到它?
【ionic-app-script在构建时失败 - 无法找到模块' @ angular / compiler-cli / ngtools2' 】完整错误:

$ ionic cordova run android --prod > ionic-app-scripts build --prod --platform android [10:08:45]ionic-app-scripts 3.2.2 [10:08:45]build prod started ... [10:08:45]clean started ... [10:08:45]clean finished in 24 ms [10:08:45]copy started ... [10:08:45]deeplinks started ... [10:08:45]deeplinks finished in 84 ms [10:08:45]ngc started ... [10:08:47]ionic-app-script task: "build" [10:08:47]Error: Cannot find module '@angular/compiler-cli/ngtools2' Error: Cannot find module '@angular/compiler-cli/ngtools2' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at C:UsersUserAppDataRoaming pm ode_modules@ionicapp-scriptsdistaotaot-compiler.js:206:90 at < anonymous> [ERROR] An error occurred while running subprocess ionic-app-scripts.

答案我解决了更新我的dev依赖项的问题
"devDependencies": { "@ionic/app-scripts": "^3.2.2", "typescript": "~2.4.2" },


    推荐阅读