gpt4 book ai didi

angular - ionic 应用程序 : an unhandled exception occurred: Could not find module “@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils”

转载 作者:行者123 更新时间:2023-12-03 15:41:45 26 4
gpt4 key购买 nike

我创建了一个空的空白 ionic 应用程序(没有电容器),添加了cordova插件并安装了google-plus包。
在packages.json 的devDependecies 部分中,我有:

"@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",
我通过执行以下操作继续构建应用程序:

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


但我得到了异常(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.jsC:\dev\myapp\node_modules@ionic\angular-toolkit\builders\cordova-build\index.jsC:\dev\myapp\node_modules@angular-devkit\architect\node\node-modules-architect-host.jsC:\dev\myapp\node_modules@angular-devkit\architect\node\index.jsC:\dev\myapp\node_modules@angular\cli\models\architect-command.jsC:\dev\myapp\node_modules@angular\cli\commands\run-impl.jsC:\dev\myapp\node_modules@angular-devkit\schematics\tools\export-ref.jsC:\dev\myapp\node_modules@angular-devkit\schematics\tools\index.jsC:\dev\myapp\node_modules@angular\cli\utilities\json-schema.jsC:\dev\myapp\node_modules@angular\cli\models\command-runner.jsC:\dev\myapp\node_modules@angular\cli\lib\cli\index.jsC:\dev\myapp\node_modules@angular\cli\lib\init.jsC:\dev\myapp\node_modules@angular\cli\bin\ngSee "C:\Users\xyz\AppData\Local\Temp\ng-EHBnHs\angular-errors.log" for further details.[ERROR] An error occurred while running subprocess ng.


我尝试了各种 SO 答案,例如清理缓存、更新、重新安装等……但我仍然收到此错误:
这里的 ionic 信息:
enter image description here
有什么办法可以修复这个错误?

最佳答案

将 devDependencies 更改为"@angular-devkit/build-angular": "~0.1000.0",删除文件夹 node_module 文件夹并运行 npm i .

关于angular - ionic 应用程序 : an unhandled exception occurred: Could not find module “@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/utils” ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64872016/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com