Install one or more released Node.js versions by a version string. The installer downloads releases and returns their installed paths.
npm install node-version-install
import install from 'node-version-install';
const result = await install('12', { storagePath: '/path/for/install' });
console.log(result); // [{ version, execPath, installPath, ... }]
import { sync as installSync } from 'node-version-install';
const result = installSync('14', { storagePath: '/path/for/install' });
console.log(result); // [{ version, execPath, installPath, ... }]
Use an options object such as { storagePath } to choose where versions are installed. See the API docs for callbacks and other options.