Ionic 离子Angular 运行问题在android?

x4shl7ld  于 9个月前  发布在  Ionic
关注(0)|答案(1)|浏览(80)

我需要运行一个旧的离子项目和使用的节点版本如下所示。

# README #

This README would normally document whatever steps are necessary to get your application up and running.

### What is this repository for? ###

* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)

### IONIC INFO ###
Ionic:

  * Ionic CLI          : 5.4.16
  * Ionic Framework    : ionic-angular 3.9.5
  * @ionic/app-scripts : 3.2.3

Capacitor:

  * Capacitor CLI   : 2.4.7
  * @capacitor/core : 2.4.7

Cordova:

  * Cordova CLI       : 11.0.0
  * Cordova Platforms : android 9.1.0
  * Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 26 other plugins)

Utility:

  * cordova-res (update available: 0.15.4) : 0.15.3
  * native-run (update available: 1.7.1)   : 1.5.0

System:

  * Android SDK Tools : 26.1.1 
  * NodeJS            : v14.16.1
  * npm               : 6.14.12
  * OS                : Windows 10

字符串
但是当我在node版本14.16.1上运行时,
Blockquote您的Node.js版本是v14.16.1。Node.js 14于2023-04-30达到生命周期结束,不再支持。请更新到最新的Node LTS版本Blockquote
所以我把node版本升级到了18.19.0
并运行命令“离子cordova运行android”它显示一个错误,
Blockquote [INFO]为Android找到硬件设备。使用--device. ng.cmd run app:ionic-cordova-build --platform=android错误:在工作区外运行Angular CLI时,此命令不可用。[错误]运行子进程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.


Blockquote
这个Angular 的安装程序已经安装,尝试卸载和重新安装也。2有没有解决这个问题的方法。

jgzswidk

jgzswidk1#

我在运行一个旧的Ionic项目时遇到了同样的问题。这是我的项目信息:

Ionic:

   Ionic CLI                     : 5.4.16 (/Users/canh/.nvm/versions/node/v16.20.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.11.13
   @angular-devkit/build-angular : 0.13.10
   @angular-devkit/schematics    : 7.3.10
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 28 other plugins)

Utility:

   cordova-res                          : 0.15.4
   native-run (update available: 2.0.0) : 1.7.2

字符串
要解决这个问题,请切换回NodeJS v14.16.1,然后安装旧版本的Cordova(它在我的项目v9.0.0中运行良好):

npm install -g [email protected]


然后重新安装node_modules
我认为问题是新版本的Cordova不再支持NodeJS v14。

相关问题