Compare commits

...

2 Commits

Author SHA1 Message Date
Christopher Dieringer
8b14f369a1
docs: update README.md
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2020-10-11 15:02:03 -07:00
cdaringe
07ed13a7bb
docs: add docker tips 2020-10-11 11:17:13 -07:00

View File

@ -9,6 +9,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)
@ -84,6 +85,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.