0

I need to run an old ionic project and the node version used is given below.

# 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

But when i run on node version 14.16.1 it shows that

Blockquote Your Node.js version is v14.16.1. Node.js 14 reached end-of-life on 2023-04-30 and is no longer supported. Please update to the latest Node LTS version Blockquote

So i upgraded the node version to 18.19.0

and run the command "ionic cordova run android" it shows an error that

Blockquote [INFO] Hardware device(s) found for android. Using --device. ng.cmd run app:ionic-cordova-build --platform=android Error: This command is not available when running the Angular CLI outside a workspace. [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.

Blockquote

the angular cli is already installed, tried uninstalling and reinstall also. Is there any solution for this.

1 Answer 1

0

I had the same problem when running an old Ionic project. This is my project's info:

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

To resolve this, switch back to NodeJS v14.16.1 then install the old version of Cordova (it worked fine in my project with v9.0.0):

npm install -g [email protected]

Then reinstall your node_modules

I think the problem is the newer versions of Cordova does not support for NodeJS v14 anymore.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.