Repository: nvm
Issue: nvm is not compatible with the npm config "prefix" option: currently set to "/usr" in alpine
Labels: needs followup

<!-- Thank you for being interested in nvm! Please help us by filling out the following form if you‘re having trouble. If you have a feature request, or some other question, please feel free to clear out the form. Thanks! -->

#### Operating system and version: mhart/alpine-node:8.10.0

#### `nvm debug` output:
<details>
<!-- do not delete the following blank line -->

```sh

```
</details>

#### `nvm ls` output:
<details>
<!-- do not delete the following blank line -->

```sh

```
</details>

#### How did you install `nvm`?
<!-- (e.g. install script in readme, Homebrew) -->
I tried installing the nvm in docker image

#### What steps did you perform?

```sh
FROM mhart/alpine-node:8.10.0
RUN apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils

# nvm environment variables
ENV NVM_DIR /root/.nvm
ENV NODE_VERSION 8.10.0

RUN /bin/bash -c 'touch ~/.bashrc'

# install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

RUN npm config delete prefix

# install node and npm
RUN source $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION
#    && nvm unalias default \
#    && nvm alias default $NODE_VERSION \
#    && nvm use default
```
#### What happened?
```sh

z013jd8@a483e70e95bb:~/Development/git/quality/spectra/cypress/docker$ docker build -t spectra:latest -f Dockerfile .
Sending build context to Docker daemon  3.059MB
Step 1/10 : FROM mhart/alpine-node:8.10.0
 ---> 7f037b85e70f
Step 2/10 : RUN apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
 ---> Using cache
 ---> fadbe966b4ec
Step 3/10 : ENV NVM_DIR /root/.nvm
 ---> Running in 196094a69ff1
Removing intermediate container 196094a69ff1
 ---> 459b6a1aa558
Step 4/10 : ENV NODE_VERSION 8.10.0
 ---> Running in 34703dedf3bc
Removing intermediate container 34703dedf3bc
 ---> b679a1ea4226
Step 5/10 : RUN /bin/bash -c 'touch ~/.bashrc'
 ---> Running in f3b64545d569
Removing intermediate container f3b64545d569
 ---> c70c0f544dcb
Step 6/10 : RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
 ---> Running in a445e6041de4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13527  100 13527    0     0  16065      0 --:--:-- --:--:-- --:--:-- 16046
=> Downloading nvm as script to '/root/.nvm'

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Installing Node.js version 8.10.0
Downloading and installing node v8.10.0...
Downloading https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
nvm is not compatible with the npm config "prefix" option: currently set to "/usr"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.10.0` to unset it.
Failed to install Node.js 8.10.0
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
Removing intermediate container a445e6041de4
 ---> cd1179842fc5
Step 7/10 : RUN npm config delete prefix
 ---> Running in 1a3f9fe38cd2
Removing intermediate container 1a3f9fe38cd2
 ---> 6f58064bf85f
Step 8/10 : RUN source $NVM_DIR/nvm.sh     && nvm install $NODE_VERSION
 ---> Running in 23a6c182215d
v8.10.0 is already installed.
nvm is not compatible with the npm config "prefix" option: currently set to "/usr"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.10.0` to unset it.
Creating default alias: default -> 8.10.0 (-> v8.10.0 *)
Removing intermediate container 23a6c182215d
 ---> db8cac5cb7df
Step 9/10 : ADD bundle.tar /
 ---> 31989d8735ce
Step 10/10 : RUN source ~/.bashrc     node --version     npm --version     yarn --version     nvm --version
 ---> Running in 365eae4bd36a
nvm is not compatible with the npm config "prefix" option: currently set to "/usr"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.10.0 --silent` to unset it.
/bin/sh: /root/.nvm/bash_completion: line 13: syntax error: unexpected "(" (expecting "}")
The command '/bin/sh -c source ~/.bashrc     node --version     npm --version     yarn --version     nvm --version' returned a non-zero code: 2
z013jd8@a483e70e95bb:~/Development/git/quality/spectra/cypress/docker$

```
#### What did you expect to happen?
Install node, yarn, nvm and cypress in docker image

#### Is there anything in any of your profile files that modifies the `PATH`?
<!--  (e.g. `.bashrc`, `.bash_profile`, `.zshrc`, etc) -->

```sh
/ # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/ # cat ~/.bashrc

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
/ #
```

<!-- Please remove the following section if it does not apply to you -->
#### If you are having installation issues, or getting "N/A", what does `curl -I --compressed -v https://nodejs.org/dist/` print out?
<details>
<!-- do not delete the following blank line -->

```sh
/ # curl -I --compressed -v https://nodejs.org/dist/
*   Trying 104.20.22.46...
* TCP_NODELAY set
* Connected to nodejs.org (104.20.22.46) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
*  start date: Oct 21 00:00:00 2019 GMT
*  expire date: Jan 18 23:59:59 2022 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
> HEAD /dist/ HTTP/1.1
> Host: nodejs.org
> User-Agent: curl/7.61.1
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Mon, 06 Apr 2020 17:10:45 GMT
Date: Mon, 06 Apr 2020 17:10:45 GMT
< Content-Type: text/html
Content-Type: text/html
< Connection: keep-alive
Connection: keep-alive
< Set-Cookie: __cfduid=ddae03beacac9d398a95895eaae430bcc1586193045; expires=Wed, 06-May-20 17:10:45 GMT; path=/; domain=.nodejs.org; HttpOnly; SameSite=Lax
Set-Cookie: __cfduid=ddae03beacac9d398a95895eaae430bcc1586193045; expires=Wed, 06-May-20 17:10:45 GMT; path=/; domain=.nodejs.org; HttpOnly; SameSite=Lax
< Cache-Control: max-age=14400
Cache-Control: max-age=14400
< CF-Cache-Status: HIT
CF-Cache-Status: HIT
< Age: 234
Age: 234
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Server: cloudflare
Server: cloudflare
< CF-RAY: 57fd1fc61aafdd93-SIN
CF-RAY: 57fd1fc61aafdd93-SIN
< Content-Encoding: gzip
Content-Encoding: gzip

<
* Connection #0 to host nodejs.org left intact
/ #
```
</details>