While working on Docker Playground, I wanted to try out installing NodeJS 14 over Alpine Linux OS. If you try to install it using apk tool, it will install NodeJS 12.
Installing NodeJS 14 is a bit tricky as the below steps won't work for you.
wget https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz
tar -xvf node-v14.4.0-linux-x64.tar.xz And once I try to run it:
~/node-v14.4.0-linux-x64/bin # ./node
sh: ./node: not found
Alpine uses musl instead of glibc, and the binaries distributed from node's website are built against glibc. Hence, the reason the official NodeJS binaries are not going to work.
How to fix this?
You need to download an unofficial build that is built against musl
wget https://unofficial-builds.nodejs.org/download/release/v14.4.0/node-v14.4.0-linux-x64-musl.tar.xz
$ ./node
Welcome to Node.js v14.4.0.
Type ".help" for more information.
>
Have queries? Reach out to me over Twitter
Top comments (0)