Home Alpine Linux How to Install Node.JS and NPM on Alpine Linux

How to Install Node.JS and NPM on Alpine Linux

Node.js is an open-source, cross-platform Javascript runtime environment, which was built on Google’s V8 Engine and developed using C++, it is an asynchronous server-side scripting language that executes JavaScript outside a web browser to develop scalable network applications.

It allows developers to build data-intensive and high-traffic backend applications such as chat apps and microservices. Notable companies that use Node.JS include GoDaddy, Netflix, Linked, Uber, PayPal, and Twitter just to mention a few.

This short guide demonstrates how to install Node.JS and NPM on Alpine Linux, but before installing, you should know about NPM.

NPM is Node.js’s package manager, which comes with a command-line tool, which you can use to search and install all open-source packages using a single command. You can also control your package’s versions, review dependencies, and even create custom scripts in your projects through the npm command-line utility.

Installing Node.JS on Alpine Linux

To get started, refresh the Alpine Linux repositories by running the following apk command:

# apk update

Next, we are going to install the Node.JS LTS release and NPM which is the package manager for NodeJS.

# apk add --update nodejs npm
OR
# apk add nodejs npm

This installs Node.JS, NPM, and all the additional packages and libraries, and dependencies from the Alpine Linux repositories.

Install Node.JS in Alpine Linux
Install Node.JS in Alpine Linux

If you want to install the current version of Node.js from the community repository, use the following command.

# apk add nodejs-current npm

Once the installation is complete, you can verify if Node.js is installed by running the command:

$ node -v

For NPM, run the following command.

$ npm -v

From the output, you can see that we have installed NodeJS version 16.14.2 and NPM 8.1.3.

Check Nodejs Version
Check Nodejs Version

And that brings us to the end of this short guide. We hope you can now comfortably install Node.JS and NPM on Alpine Linux.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.