Node Version Manager (NVM) is a bash script for managing Node.js versions.
It can be used to:
- Make a specific version available in the build and optionally the runtime container.
- Control the specific versions to be installed with environment variables, meaning you can also have different versions in different environments.
To use it, you need to:
- define environment variables with NVM and NODE versions in your
.platform.app.yaml
file - add a .nvm directory to your cache in your build hook
- use the cache directory and install based on the variables if not present:
The detailed steps to use nvm can be found in this documentation.