离子5问题NG子进程与角14
我有这个问题。当我编译应用程序并运行命令离子Cordova准备Android时,我会看到此错误:
Error: Unknown argument: platform [ERROR] An error occurred while running subprocess ng. ng.cmd run app:ionic-cordova-build --platform=android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
我的配置: 角CLI:14.0.2 节点:16.13.0 软件包管理器:NPM 8.1.0 OS:Win32 X64 如果我用此config将同一命令午餐: 角CLI:13.0.4 节点:16.13.0 软件包管理器:NPM 8.1.0 OS:Win32 X64 项目工作正确,
您有一个解决方案吗?
I have this problem. When I compile an application and run the command ionic cordova prepare android i see this error:
Error: Unknown argument: platform [ERROR] An error occurred while running subprocess ng. ng.cmd run app:ionic-cordova-build --platform=android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
My Config:
Angular CLI: 14.0.2
Node: 16.13.0
Package Manager: npm 8.1.0
OS: win32 x64
If i lunch the same command with this config:
Angular CLI: 13.0.4
Node: 16.13.0
Package Manager: npm 8.1.0
OS: win32 x64
the project work correctly
Have you a solution??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
yo lo logre con comando ng添加 @ionic/cordova-Builders
yo lo logre con este comando ng add @ionic/cordova-builders
此错误发生了,您没有以Angular到Ionic的方式进行应用程序的迁移,解决方案很简单。
运行
如果您使用的是离子角服务器,请确保也更新它:
但是,如果该代码不运行,请尝试此代码:
如果需要阅读迁移的文档:
https://ionicframework.com/docs/reference/migration/migration
我希望对您有所帮助
This error happen beacause you don't did the migration of an application in Angular to Ionic, the solution is simple.
Run
If you are using Ionic Angular Server, be sure to update that as well:
However if that's code don't run try this code:
if need read the documentation of the migration:
https://ionicframework.com/docs/reference/migration
I hope than help you
尝试
ng添加 @ionic/cordova-Builders
try
ng add @ionic/cordova-builders
对我来说,此错误的原因是因为我将NPM版本更改为当时没有用于安装离子的不同版本。因此,离子似乎取决于您用来安装它的NPM版本,具体取决于版本的变化程度。
For me, the cause of this error was because I had changed my npm version to a different version that wasn't used to install ionic at that time. So, it seems ionic depends on that npm version you used to install it, depending on how drastic the version change was.