While attempting to get my checkers network server and the accompanying nodejs-based web application for spectating and playing checkers games running on the Raspberry Pi, I quickly ran into trouble. My Raspberry Pi is running Raspbian, and the nodejs package delivered through APT is ancient 0.6.x.
I developed against nodejs 0.10.25, since that is the latest version of the package for Ubuntu 14.04.1 LTS, the OS I'm running on my laptop. I tried porting the application to the earlier versions, but it quickly turned into a nightmare with library dependencies constantly breaking. I decided it would be better if I could just install the same version of nodejs I developed on.
I developed against nodejs 0.10.25, since that is the latest version of the package for Ubuntu 14.04.1 LTS, the OS I'm running on my laptop. I tried porting the application to the earlier versions, but it quickly turned into a nightmare with library dependencies constantly breaking. I decided it would be better if I could just install the same version of nodejs I developed on.
I found many instructions for how to install nodejs on the Raspberry Pi, but a number of them had you adding third-party APT repositories or grabbing third-party package files. These instructions may, and probably do, work just fine. However, I wanted to skip all the third-parties and get nodejs from the source. Fortunately, this was extremely simple.
Nodejs distributes builds for the Raspberry Pi. Installing the exact version I developed on was as simple as:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch the tarball from the nodejs distribution site | |
wget http://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-arm-pi.tar.gz | |
# Install the tarball under /usr/local | |
cd /usr/local | |
tar --strip-components 1 xfz /home/pi/node-v0.10.25-linux-arm-pi.tar.gz |
No comments:
Post a Comment