Skip to content

Node 18 fails to install on Alpine 3.23 #3747

@pooley182

Description

@pooley182

Operating system and version:

Alpine Linux v3.23

nvm debug output:

Details
nvm --version: v0.40.3
$SHELL:
$SHLVL: 1
whoami: 'root'
${HOME}: /root
${NVM_DIR}: '/'
${PATH}: ${NVM_DIR}usr${NVM_DIR}local${NVM_DIR}sbin:${NVM_DIR}usr${NVM_DIR}local${NVM_DIR}bin:${NVM_DIR}usr${NVM_DIR}sbin:${NVM_DIR}usr${NVM_DIR}bin:${NVM_DIR}sbin:${NVM_DIR}bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
/bin/sh: --version: not found
shell version: ''
uname -a: 'Linux 6.17.8-orbstack-00308-g8f9c941121b1 #1 SMP PREEMPT Thu Nov 20 09:34:02 UTC 2025 aarch64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Welcome to Alpine Linux 3.23
awk: warning: option -W is ignored
awk: /usr/bin/awk,
curl: /usr/bin/curl, curl 8.17.0 (aarch64-alpine-linux-musl) libcurl/8.17.0 OpenSSL/3.5.4 zlib/1.3.1 brotli/1.2.0 zstd/1.5.7 c-ares/1.34.6 libidn2/2.3.8 libpsl/0.21.5 nghttp2/1.68.0 nghttp3/1.13.1
wget: unrecognized option: V
wget: /usr/bin/wget,
git: not found
grep: /bin/grep, grep (GNU grep) 3.12
sed: /bin/sed, BusyBox v1.37.0 (2025-12-16 14:19:28 UTC) multi-call binary.
cut: /usr/bin/cut, cut (GNU coreutils) 9.8
basename: /usr/bin/basename, basename (GNU coreutils) 9.8
rm: /bin/rm, rm (GNU coreutils) 9.8
mkdir: /bin/mkdir, mkdir (GNU coreutils) 9.8
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.10.0
nvm current: none
which node:
which iojs:
which npm:
npm config get prefix: ${NVM_DIR}bin${NVM_DIR}sh: npm: not found
npm root -g: ${NVM_DIR}bin${NVM_DIR}sh: npm: not found

nvm ls output:

Details
            var
iojs -> N/A (default)
node -> stable (-> N/A) (default)
stable -> ar (-> N/A) (default)
unstable -> N/A (default)
lts/* -> lts/krypton (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.8 (-> N/A)
lts/iron -> v20.19.6 (-> N/A)
lts/jod -> v22.21.1 (-> N/A)
lts/krypton -> v24.12.0 (-> N/A)

How did you install nvm?

What steps did you perform?

I attempted to install node 18, using NVM within an Alpine 3.23 docker container.
These same steps work fine when using Alpine 3.22

  • Start container
docker run --rm -it alpine:3.23 /bin/sh
  • Install dependencies and NVM, then attempt to install Node 18
apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++
 libgcc linux-headers grep util-linux binutils findutils

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

. /root/.nvm/nvm.sh

nvm install 18

What happened?

In file included from /usr/include/c++/15.2.0/memory:80,
                 from ../src/inspector/worker_inspector.h:8:
/usr/include/c++/15.2.0/bits/unique_ptr.h: In instantiation of 'std::__detail::__unique_ptr_t<_Tp> std::make_unique(_Args&& ...) [with _Tp = node::inspector::ParentInspectorHandle; _Args = {int&, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, shared_ptr<node::inspector::MainThreadHandle>&, bool&, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&}; __detail::__unique_ptr_t<_Tp> = __detail::__unique_ptr_t<node::inspector::ParentInspectorHandle>]':
../src/inspector/worker_inspector.h:64:51:   required from here
   64 |     return std::make_unique<ParentInspectorHandle>(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   65 |         thread_id, url, parent_thread_, wait_, name);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/15.2.0/bits/unique_ptr.h:1085:30: error: no matching function for call to 'node::inspector::ParentInspectorHandle::ParentInspectorHandle(int&, const std::__cxx11::basic_string<char>&, std::shared_ptr<node::inspector::MainThreadHandle>&, bool&, const std::__cxx11::basic_string<char>&)'
 1085 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/15.2.0/bits/unique_ptr.h:1085:30: note: there are 2 candidates
../src/inspector/worker_inspector.h:54:7: note: candidate 1: 'node::inspector::ParentInspectorHandle::ParentInspectorHandle()'
   54 | class ParentInspectorHandle {
      |       ^~~~~~~~~~~~~~~~~~~~~
../src/inspector/worker_inspector.h:54:7: note: candidate expects 0 arguments, 5 provided
../src/inspector/worker_inspector.h:54:7: note: candidate 2: 'node::inspector::ParentInspectorHandle::ParentInspectorHandle(const node::inspector::ParentInspectorHandle&)'
../src/inspector/worker_inspector.h:54:7: note: candidate expects 1 argument, 5 provided
../src/inspector/worker_inspector.cc: At global scope:
../src/inspector/worker_inspector.cc:39:6: warning: 'void node::inspector::{anonymous}::Report(const std::unique_ptr<node::inspector::WorkerDelegate>&, const node::inspector::WorkerInfo&, bool)' defined but not used [-Wunused-function]
   39 | void Report(const std::unique_ptr<WorkerDelegate>& delegate,
      |      ^~~~~~
make[1]: *** [libnode.target.mk:435: /.cache/src/node-v18.20.8/files/out/Release/obj.target/libnode/src/inspector/worker_inspector.o] Error 1
make[1]: *** Waiting for unfinished jobs....
rm a35ce3106b61a69042d275883f485d438439e264.intermediate c359a980496ba9cfa77786b855112ffcc6d3a66b.intermediate
make: *** [Makefile:135: node] Error 2
nvm: install v18.20.8 failed!

What did you expect to happen?

Node 18 to be installed.

Is there anything in any of your profile files that modifies the PATH?

No

✏️ Edit:

Further testing confirms that

  • node 18 (18.20.8) installs via NVM from source fine on Alpine 3.22
  • node 20 (20.19.6) installs via NVM from source fine on Alpine 3.23
Now using node v18.20.8 (npm v10.8.2)
Creating default alias: default -> 18 (-> v18.20.8)
/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.22.2
PRETTY_NAME="Alpine Linux v3.22"
Now using node v20.19.6 (npm v10.8.2)
Creating default alias: default -> 20 (-> v20.19.6)
/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.23.2
PRETTY_NAME="Alpine Linux v3.23"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions