Installing and removing Node.js on linux-based Systems-for raspberry pi 4B
Published: July 26, 2024 at 12:00 AM UTC+0200
Last edited: 23 October, 2025 at 3:39 PM UTC+0200
Author: Richard Djarbeng
Less than a 1 min read
To install Node.js 16 after uninstalling Node.js 18, you can use the NodeSource repository to get the specific version you want. Here’s a step-by-step guide using the terminal:

Remove the existing Node.js version
sudo apt remove nodejs
Install the NodeSource repository for Node.js 16
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
Install Node.js 16
sudo apt install -y nodejs
This will install Node.js 16 on your system. You can verify the installation by checking the version:
node -v
This should output the version of Node.js 16 that you just installed.
Categories:
IoT
Tagged In:
Related Posts
« Previous post: