This commit is contained in:
Christopher Dieringer 2022-02-09 04:36:48 +05:30 committed by GitHub
commit 19222b1835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- [Installing and Updating](#installing-and-updating)
- [Install & Update Script](#install--update-script)
- [Additional Notes](#additional-notes)
- [Installing in Docker](#installing-in-docker)
- [Troubleshooting on Linux](#troubleshooting-on-linux)
- [Troubleshooting on macOS](#troubleshooting-on-macos)
- [Ansible](#ansible)
@ -115,6 +116,23 @@ Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not conta
- The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.
#### Installing in Docker
To install `nvm` in Docker, you may need to prepare your image's environment in advance in order to use `node` & `npm`. Here's a winning recipe:
```Dockerfile
# set your target node version
ENV NODE_VERSION 14.13.1
# set NVM_DIR
ENV NVM_DIR="$HOME/.nvm"
# patch PATH
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# install!
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install ${NODE_VERSION}
```
#### Troubleshooting on Linux
On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.