Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Asdf nodejs plugin inside alpine container : ~/.asdf/installs/nodejs/17.3.0/bin/node: No such file or directory #281

Closed
trompx opened this issue Jan 4, 2022 · 8 comments
Labels
node-build Related to node-build

Comments

@trompx
Copy link

trompx commented Jan 4, 2022

Describe the Bug

I try to install asdf with nodejs plugin in an alpine docker container.

While it works in an ubuntu 18.04 docker image, it fails in alpine.

Steps to Reproduce

Start of the Dockerfile

FROM ubuntu:18.04
RUN apt-get update -q && apt-get install -y \
  curl \
  git

And

FROM alpine:latest
RUN apk --no-cache add bash git curl

End of the Dockerfile

RUN adduser --shell /bin/bash --home /ci --disabled-password ci

ENV PATH="${PATH}:/ci/.asdf/shims:/ci/.asdf/bin"
ENV NODEJS_CHECK_SIGNATURES=no

USER ci
WORKDIR /ci

RUN git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf && \
    echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc && \
    echo '. $HOME/.asdf/asdf.sh' >> $HOME/.profile

RUN asdf plugin-add nodejs
RUN asdf install nodejs latest
RUN asdf global nodejs latest

# With Ubuntu 18.04, this works. With alpine, this fails with the error:
# /ci/.asdf/lib/commands/command-exec.bash: line 28: /ci/.asdf/installs/nodejs/17.3.0/bin/node: No such file or directory
# STDERR: The command '/bin/sh -c node --version' returned a non-zero code: 127
RUN node --version
RUN npm -v

Expected Behaviour

Node shoud be found like in ubuntu. I checked inside the container with a ls /ci/.asdf/installs/nodejs/17.3.0/bin and the node file exists.

Actual Behaviour

I get the error:

/ci/.asdf/lib/commands/command-exec.bash: line 28: /ci/.asdf/installs/nodejs/17.3.0/bin/node: No such file or directory
STDERR: The command '/bin/sh -c node --version' returned a non-zero code: 127

Environment

OS:
Linux 0fdc9c1601ae 5.8.0-45-generic asdf-vm/asdf#51~20.04.1-Ubuntu SMP Tue Feb 23 13:46:31 UTC 2021 x86_64 Linux

SHELL:
GNU bash, version 5.1.8(1)-release (x86_64-alpine-linux-musl)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ASDF VERSION:
v0.9.0-87137e4

ASDF ENVIRONMENT VARIABLES:

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master ed34355

asdf plugins affected (if relevant)

nodejs

@Stratus3D Stratus3D transferred this issue from asdf-vm/asdf Jan 6, 2022
@Stratus3D
Copy link
Member

I have moved this issue to the asdf-nodejs repo as I believe it's specific to nodejs.

ENV PATH="${PATH}:/ci/.asdf/shims:/ci/.asdf/bin"

You shouldn't need that line. And if you want to manually set the path asdf dirs should come before everything else.

@Stratus3D
Copy link
Member

What happens if you run asdf reshim prior to trying to use node?

@johnhamelink
Copy link

node-build does not yet support musl libc: nodenv/node-build#722

@augustobmoura
Copy link
Member

Hello @trompx, check if after following the steps on #190 (comment) you can get it working.

@augustobmoura augustobmoura added the node-build Related to node-build label Feb 22, 2022
@Nate-Wilkins
Copy link

This is a bit old but I'm seeing a similar behavior on alpine in my docker container. But mine looks like:

bash: /root/.asdf/installs/nodejs/19.1.0/bin/node: cannot execute: required file not found

Any progress on this? I'm not even sure how to debug this.

@vuldin
Copy link

vuldin commented Jan 1, 2023

This likely an issue that is resolved by installing libc6-compat. Add this to the alpine dockerfile:

RUN apk update && apk upgrade && apk add bash libc6-compat

@Stratus3D
Copy link
Member

@augustobmoura do you want to close this issue? Or is there something else we can do for it?

@augustobmoura
Copy link
Member

Let's close this in favor of #190, we can keep the discussion over there

@augustobmoura augustobmoura closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-build Related to node-build
Projects
None yet
Development

No branches or pull requests

6 participants