Skip to content

Instantly share code, notes, and snippets.

@jokesterfr
Last active December 4, 2023 20:35
Show Gist options
  • Save jokesterfr/32e9a3191ca9dca61ef067157d69a4cf to your computer and use it in GitHub Desktop.
Save jokesterfr/32e9a3191ca9dca61ef067157d69a4cf to your computer and use it in GitHub Desktop.

Compile and install Node.js and pnpm (yarn and npm are included), Node.js requires Python 3 but no more than Python 3.12... https://github.com/nodejs/node/blob/main/configure#L7 To circumvent this, you can directly call python3 ./configure.py instead of ./configure:

NODE_VERSION=16.16.0
curl --silent --fail --location --output /tmp/node.tar.gz "https://nodejs.org/dist/v${NODE_VERSION}/node-v$NODE_VERSION.tar.gz" \
  && tar xzf /tmp/node.tar.gz \
  && cd "node-v$NODE_VERSION" \
  && apk add --no-cache --virtual .build-deps \
  bash \
  binutils-gold \
  curl \
  g++ \
  gcc \
  gnupg \
  libgcc \
  linux-headers \
  make \
  python3 \
  ccache \
  xz \
  && python3 ./configure.py \
  && make VARIATION="musl" \
  && make install \
  && npm install -g pnpm@latest --force

Takes a while, not the best idea in the world. I recommend to intall stdlib & gcc on alpine rather than trying this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment