📜 ⬆️ ⬇️

Installing node.js on Raspberry Pi

Logo Raspberry and Node.js

Hi, Habr! The article is dedicated to web developers, which fell into the hands of the first model of Raspberry Pi. When I bought raspeberry a few years ago it was a computer for $ 35, today it is a TV box and a home server for IoT devices. For the first model, not so many linux systems are left; basically, they are all already upgraded to raspberry 2+. I checked on 2 systems: OSMC and Pidora (cut down fedora), the whole world is indignant about the unfortunate name Pidora Link to Chris Tyler's quote , but nothing can be done, it has already taken root. I had the only problem when installing the system - the SD card needs to be formatted in the FAT32 primary partition. In the case of OSMC, I connected via ethernet to the root device, pidora allows you to perform similar manipulations via the command line as a system administrator.


Next, I advise you to go to https://nodejs.org/dist/ to find the latest version of a stable version of LTS, at the time of this writing it was v6.9.1, the main thing that you should find in the name of the armv6l file for Raspberry Pi 1, or armv7l for Raspberry Pi 2+ it says about the version of ARM architecture for the computer processor .
Next, create a folder in which our node will be.


Next command:
')
wget https://nodejs.org/dist/latest-v6.x/node-v6.9.1-linux-armv6l.tar.gz 
Download node.js in our directory

All great downloaded:


Unpack the archive

 tar -xvf node-v6.9.1-linux-armv6l.tar.gz 


Rename the folder with our node:

 mv node-v6.9.1-linux-armv6l node-v6 


We believe the presence of files inside the folder:

 cd node-v6 ls 


Next we get a full link to our folder to add node.js to PATH:

 readlink -m CHANGELOG.md 


Add Node.js to the PATH, be careful in this step , because if you mess up, then everything will have to be repeated anew, starting with the installation of the system;)

 export PATH=$PATH:/home/osmc/node/node-v6/bin 


Check that our path is added:

 $PATH 


And voila, javascript on your raspberry :)


You made sure that node.js can be installed in any folder and the system will know about it, and we made sure that you need to install a new node on the old Raspberry Pi.

Source: https://habr.com/ru/post/314540/


All Articles