The following instructions will install programs that we have found useful. The first four commands are one-liners using apt-get install. The instructions that follow illustrate a procedure that is required when you need a different version of the software than is available by the straightforward method. We reproduce with accompanying explanatory notes the steps given in this GitHub page for installing version 0.10.25 of Node.js (which facilitates networking).
Note added in November 2019: There is now an excellent Instructables page entitled "Install Node.js and Npm on Raspberry Pi". Following the instructions we found that the latest version of Node for our armv6l Raspberry Pi is node-v11.15.0-linux-armv6l.tar.gz and installed it on the latest Debian OS flashed to replace an old version of Debian on an 8GB SD card. This version of node allowed us to install successfully socket.io, ws and node-static with the commands sudo npm install socket.io, sudo npm install ws and sudo npm install node-static issued from the home directory.
Type the commands at the prompt according to your requirements and accept invitations to continue.
sudo apt-get install openjdk-6-jdk
(for the a Java Development Kit with its java and jar programs)
sudo apt-get install usbmount
(so that you can access your usb stick easily from the command line)
sudo apt-get install scrot
(for the screen shot application)
sudo apt-get install sqlite3
- sudo apt-get update
sudo apt-get upgrade
Be prepared for this to take a long time; allow an hour to be on the safe side.
- If you have installed another version of Node.js, remove it with (depending on the installation sudo apt-get remove nodejs or sudo apt-get remove node. You may need to delete the node directories and a symbolic link.
sudo su -
This command switches the user to root.
This change the directory to where Node.js will be installed.
This downloads the required zipped archive.
tar xvzf node-v0.10.25-linux-arm-pi.tar.gz
This extracts (x) verbosely (v), the zipped (z) file (f). See this useful page for information about tar.
ln -s node-v0.10.25-linux-arm-pi node
This created the symbolic link named node to refer to node-v0.10.25-linux-arm-pi.
chmod a+rw /opt/node/lib/node_modules
This provides read/write access for all users to the node_modules folder.
chmod a+rw /opt/node/bin
This provides read/write access for all users to the bin folder.
echo 'PATH=$PATH:/opt/node/bin' > /etc/profile.d/node.sh
- Reboot then test with the command node --version.