The Raspberry Pi is a great Multi Purpose mini Linux based computer you can use for almost anything. It can be used to create fun side projects. The Python 2.7 programming language is usually available by default on Raspbian and two code Editors are usually available i.e. Geany and Thonny, which are great tools to play around with.
This is great, but most developers usually prefer to develop software on their laptops and deploy their code to a server or another device to run it on. In some cases you probably do not want to use Python to develop your application.
Does Raspberry Pi support NodeJS
NodeJS is an ever moving target and there are new releases of the framework every couple of months. One older versions of Raspberry Pi previous versions of NodeJS was supported but they had to be specifiically compiled to support ARM chipsets. I have previously posted about installing older versions of NodeJS on Raspberry Pi.
In this post we will be discussing how to install NodeJS on the Raspberry Pi B+ version 2 and above. There are 2 ways of finding out your version of Raspberry Pi, the first you can read the circuit board and it will be printed next to the Raspberry Pi Logo.
The second approach to finding the version, is to use the handy Linux uname command . To do so you can either open a terminal window or connect to Raspberry Pi using SSH and execute the following command.
Equipment used in this tutorial
- Raspberry Pi 3 Model B+
- RJ45 connection cable
- Broadband Router
- Network switch
- TP-LINK AV2000 Powerline Adapter Kit, 2-Port,
Installing Node Version Manager on Raspberry Pi
There are a lot of different versions of Node out there. These tools will help you keep track of what version you are using, and also make it easy to install new versions and switch between them.
When developing software using Node you will invariably need o switch between different versions to debug and test. Node Version Manager (NVM) makes this a completely seamless process.
The process to installing NVM on Raspberry Pi is similar to installing NVM on Ubuntu and the instructions for using it are exactly the same.
To install NVM on your Raspberry Pi simply use the following command in a terminal window
Once the installation has completed, you will need to refresh your Bash profile to ensure the new commands become available in your current terminal session
Installing Node versions with NVM on Raspberry Pi
Once NVM has finished installing you can install the node version of your choice on your Raspberry Pi.
In my case I want to install Version 10 on my Pi using
Once complete you can use node to check your version number
You can also check which version of npm (Node Package Manager) has been installed using
The process to installing Node Version Manager and Node on your Raspberry Pi is not too dissimilar to installing it on any other *nix based systems.