离子5问题NG子进程与角14

发布于 2025-02-08 07:28:31 字数 493 浏览 3 评论 0原文

我有这个问题。当我编译应用程序并运行命令离子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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

默嘫て 2025-02-15 07:28:31

yo lo logre con comando ng添加 @ionic/cordova-Builders

yo lo logre con este comando ng add @ionic/cordova-builders

惟欲睡 2025-02-15 07:28:31

此错误发生了,您没有以Angular到Ionic的方式进行应用程序的迁移,解决方案很简单。

运行

npm install @ionic/angular@6

如果您使用的是离子角服务器,请确保也更新它:

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/migration

我希望对您有所帮助

This error happen beacause you don't did the migration of an application in Angular to Ionic, the solution is simple.

Run

npm install @ionic/angular@6

If you are using Ionic Angular Server, be sure to update that as well:

npm install @ionic/angular@6 @ionic/angular-server@6

However if that's code don't run try this code:

npm install @ionic/angular@latest @ionic/angular-toolkit@latest --save

if need read the documentation of the migration:

https://ionicframework.com/docs/reference/migration

I hope than help you

幻想少年梦 2025-02-15 07:28:31

尝试ng添加 @ionic/cordova-Builders

try ng add @ionic/cordova-builders

☆獨立☆ 2025-02-15 07:28:31

对我来说,此错误的原因是因为我将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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文