Sunday, October 02, 2022

How to install latest version of Node.js on Raspberry Pi 3?

How to install latest version of Node.js on Raspberry Pi 3?

🔥 Save unlimited web pages along with a full PDF snapshot of each page.
Unlock Premium →

Published by Amritpal Singh on December 25, 2017 with 7 Comment
Categories: Tutorials

In this tutorial, you will learn to install the latest version of Node.js on your Raspberry Pi 3. The latest image of Raspbian Operating System (as of December 2017) contains an older version of the Node.js application. You can manually update it to the latest version by removing the existing version and re-installing the newest version using "n â Interactively Manage Your Node.js Versions."

Step 1: First remove existing old version from Raspberry Pi

pi@raspberrypi:~ $ sudo -i
root@raspberrypi:~# apt-get remove nodered -y
root@raspberrypi:~# apt-get remove nodejs nodejs-legacy -y
root@raspberrypi:~# exit

Step 2: Installing n will automatically install latest stable version of Node.js

curl -L https://git.io/n-install | bash

Step 3: Verify your installation version

pi@raspberrypi:~ $ node --version
pi@raspberrypi:~ $ npm --version

Step 4: Optional: You can easily switch to different releases

Use or install the latest official release:
pi@raspberrypi:~ $ n latest
Use or install the stable official release:
pi@raspberrypi:~ $ n stable
Use or install the latest LTS official release:
pi@raspberrypi:~ $ n lts

You should now successfully have latest version of Node.js on your Raspberry Pi, if you have any issues please ask question in comments.

Source: https://linux.tips/tutorials/how-to-install-latest-version-of-node-js-on-raspberry-pi-3
This web page was saved on Saturday, Oct 01 2022.

Upgrade to Premium Plan

✔ Save unlimited bookmarks.

✔ Get a complete PDF copy of each web page

✔ Save PDFs, DOCX files, images and Excel sheets as email attachments.

✔ Get priority support and access to latest features.

Upgrade now →

1 comment:

ALGO said...

do following to prevent run . /home/pi/.bashrc every single time

echo 'source ~/.profile' >> ~/.bash_profile