当我在浏览器上运行应用程序时,我得到了错误。
ionic cordova run browser错误是
Error: Unknown argument: platform [ERROR] An error occurred while running subprocess ng. ng.cmd run app:ionic-cordova-build --platform=browser exited with exit code 1. Re-running this command with the --verbose flag may provide more information.我的康菲斯
离子:
离子CLI : 6.13.1离子框架:@离子/角6.1.13 @角-devkit/构建角: 14.0.5 @角-devkit/示意图: 14.0.5 @角/cli: 14.0.5 @离子/角-工具包: 6.1.0
科多瓦:
Cordova CLI : 11.0.0 Cordova平台: browser 6.0.0 Cordova Plugins :cordova-plugin-离子型-键盘2.2.0,cordova-plugin-离子型-webview 5.0.0,(和4个其他插件)
效用:
cordova-res : 0.15.4原生运行: 1.6.0
系统:
Android工具: 26.1.1 NodeJS :v16.16.0NPM:8.2.0OS: Windows 10
发布于 2022-07-09 16:29:23
我找到了解决办法,我遗漏的是
ng add @ionic/cordova-builders它是使用Cordova的@离子型/角形项目的建设者的集合。
此解决方案也适用于android和ios。
发布于 2022-07-11 13:38:05
这个错误的发生是因为你没有把一个应用程序的角度迁移到Ionic,所以解决方案很简单。
跑
npm install @ionic/angular@6如果您使用的是Ionic,请确保更新该服务器:
npm install @ionic/angular@6 @ionic/angular-server@6但是,如果该代码没有运行,请尝试以下代码:
npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save如果需要,请阅读迁移文档:
https://ionicframework.com/docs/reference/migration
我希望能帮你
https://stackoverflow.com/questions/72923032
复制相似问题