1

I am trying to run an Ionic project using Node version 14.18.3

I am using Volta to set this version for this one particular project

To do this I ran this command:

volta pin node@14

If I navigate to my project and run node -v then I see 14.18.3

When I try and build my project it fails and gives me an error that indicates that my node version is not 14

If I run ionic info then I see the following output. This shows that my node version is 16.13.1

Question - where is 16.13.1 coming from? How do I get Ionic to run using node 14?

Ionic:

   Ionic CLI          : 6.18.1 (/Users/chris/.volta/tools/image/packages/@ionic/cli/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 9.0.0, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 17 other plugins)

Utility:

   cordova-res                          : 0.15.4
   native-run (update available: 1.5.0) : 0.3.0

System:

   Android SDK Tools : 26.1.1 (/Users/chris/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v16.13.1 (/Users/chris/.volta/tools/image/node/16.13.1/bin/node)
   npm               : 8.2.0
   OS                : macOS Monterey
   Xcode             : Xcode 13.2.1 Build version 13C100
Chris
  • 4,672
  • 13
  • 52
  • 93
  • The usual culprits are ionic not seeing the `PATH` with the injected volta shims, or a module somewhere along the chain was installed with 16.13.1 and is referencing the 16 paths directly. If you reinstall the projects deps under node 14 and run `./node_modules/.bin/ionic info` does it make any difference? – Matt Jan 18 '22 at 23:43
  • 2
    I'm opting to post this as a comment and not an answer, because I'm not perfectly sure of all the reasons for this behaviour... suffice to say, I've had very similar issues myself, and the only way I've got around them is to prepend `volta run --node `, where `` is the NodeJS version you need to use, and `` is what you were trying to run (like `ionic info`). hope that at least helps until you find a better solution.. – Andre Greeff May 11 '22 at 12:07

0 Answers0