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.
1 comment:
do following to prevent run . /home/pi/.bashrc every single time
echo 'source ~/.profile' >> ~/.bash_profile
Post a Comment