Question

How I download and extract different Node versions?

Posted June 4, 2021 54 views
GitDigitalOceanHTMLSpin UpDigitalOcean App Platform

I tried using a static app using a fairly complex static app. It exited on a crypto library because I it requires a different node version. This is what was extracted
[2021-06-04T00:32:32.768927749Z] —> Downloading and extracting Node v16.3.0

I want to get it to say “Downloading and extracting Node v12.18.

Is that doable? Or, do I need a docker droplet?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

As I understand you want to use Node v12.18 on the app platform.
You can do this by defining the Nodejs version in your package.json file,

Here is an example of the property of the engine for the current Node LTS version:

{ 
  "engines" : { 
    "node" : "12.18.0" 
  }
}

Hi there,

There has been a similar question here.

This is configurable in your package.json file use the engines property. More info here

Here is an example of the engines property for the current Node LTS version:

{ 
  "engines" : { 
    "node" : "12.19.0" 
  }
}

Here is another example of the engines property that span between inclusive Node versions v12 to v14:

{ 
  "engines" : { 
    "node" : ">=12.0.0 <=14.0.0" 
  }
}

Regards,
Bobby
Source.