Merge 8b14f369a1 into 39d9a42c35
This commit is contained in:
commit
19222b1835
18
README.md
18
README.md
|
|
@ -10,6 +10,7 @@
|
||||||
- [Installing and Updating](#installing-and-updating)
|
- [Installing and Updating](#installing-and-updating)
|
||||||
- [Install & Update Script](#install--update-script)
|
- [Install & Update Script](#install--update-script)
|
||||||
- [Additional Notes](#additional-notes)
|
- [Additional Notes](#additional-notes)
|
||||||
|
- [Installing in Docker](#installing-in-docker)
|
||||||
- [Troubleshooting on Linux](#troubleshooting-on-linux)
|
- [Troubleshooting on Linux](#troubleshooting-on-linux)
|
||||||
- [Troubleshooting on macOS](#troubleshooting-on-macos)
|
- [Troubleshooting on macOS](#troubleshooting-on-macos)
|
||||||
- [Ansible](#ansible)
|
- [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.
|
- 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
|
#### 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.
|
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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue