To install Node.js nvm in Docker, we run curl
to install it.
For instance, in our dockerfile, we add
SHELL ["/bin/bash", "--login", "-c"]
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
RUN nvm install 10.15.3
to run curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
to download the nvm install script and run bash to install it with the downloaded script.
And then we run
nvm install 10.15.3
to install nvm 10.15.3.