Fork me on GitHub

Project Notes

#295 Node.js Ubuntu

Installing and maintaining Node.js on Ubuntu

Notes

I’m currently running Ubuntu 22.04:

$ uname -v
#44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2

The version of Node.js included with Ubuntu 22.04, version 12.22.9, is an LTS release. It is technically outdated, but should be supported until the release of Ubuntu 24.04.

$ sudo apt install nodejs
$ node -v
v12.22.9

So while that is possible, I’ll remove it to install a later version:

sudo apt remove nodejs

To install node v22, I’m using nvm:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
..
$ nvm install 22
..
$ node -v
v22.6.0

Note: this requires a working curl. The version installed with snap is not compatible. So if necessary, replace it with on installed via apt:

sudo snap remove curl
sudo apt-get update
sudo apt-get install curl

Credits and References

About LCK#295 node

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

Project Source on GitHub Return to the LittleCodingKata Catalog
About LittleCodingKata

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.

Follow the Blog follow projects and notes as they are published in your favourite feed reader