Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compiling Node.JS on Alpine Linux
apk update
apk install curl python build-base gcc abuild binutils binutils-doc gcc-doc linux-headers
curl -L -O https://nodejs.org/dist/v4.6.0/node-v4.6.0.tar.gz
tar xzf node-v4.6.0.tar.gz
cd node-v4.6.0
./configure
make
make install
@duhaime

This comment has been minimized.

Copy link

@duhaime duhaime commented Mar 27, 2018

This wouldn't book on my Amazon Linux container, but a slightly modified version would:

RUN NODE_VERSION="v9.9.0" && \
    apk add --update --no-cache curl \
    make \
    python \
    g++ \
    gcc \
    gcc-doc \
    linux-headers && \
  curl -L -O https://nodejs.org/dist/latest-v9.x/node-$NODE_VERSION.tar.gz && \
  tar xzf node-$NODE_VERSION.tar.gz && \
  cd node-$NODE_VERSION && \
  ./configure && \
  make && \
  make install
@souparno

This comment has been minimized.

Copy link

@souparno souparno commented Jan 21, 2019

how to download npm? also, does node-gyp needs to be built as well?

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