jorgebucaran / nvm.fish

The Node.js version manager you'll adore, crafted just for Fish
https://git.io/nvm.fish
MIT License
2.08k stars 69 forks source link

Add musl support #156

Closed jrschumacher closed 3 years ago

jrschumacher commented 3 years ago

On alpine linux the installed version of node won't execute because its built with libc not musl.

Test

  1. Create a Dockerfile with the following steps and run docker build . you will see an error (screenshot).
  2. Make change and try again you will see error related invalid mirror or host, but then the second command will succeed.

**NOTE:

FROM alpine

# Setup
RUN apk update && \
    apk add ca-certificates fish curl

SHELL ["/usr/bin/fish", "--login", "-c"]

RUN curl -sL https://git.io/fisher | source && \
    fisher install jorgebucaran/fisher && \
    fisher install jorgebucaran/nvm.fish 

# Try install node
RUN nvm install 14 && nvm uninstall 14

# Set the unoffical builds mirror (supports musl) and install
# Version 16 does not support musl yet
RUN set -U nvm_mirror https://unofficial-builds.nodejs.org/download/release && \
    nvm install 14

image

Proof

image

jorgebucaran commented 3 years ago

I took a different approach by introducing nvm_arch that allows you to override the architecture parameter.

You should be able to get around this issue using the following recipe.

set nvm_mirror https://unofficial-builds.nodejs.org/download/release 
set nvm_arch_suffix x64-musl