Skip to content →

Category: Raspberry Pi

Node.js on the Raspberry Pi

I needed to install Node.js on the Raspberry Pi and searching the web gave me so many difficult ways to do it. But since node.js now distributed as a binary for the Raspberry Pi, it’s pretty easy.

First, go to http://nodejs.org/dist/latest/ and find the latest Raspberry Pi release. It’s the file ending in: linux-arm-pi.tar.gz

Then on the Raspberry Pi, update the package list

sudo apt-get update

Update packages

sudo apt-get upgrade -y

Create a directory to install node:

sudo mkdir /opt/node

Change directories to a temporary directory.

cd /tmp

Download the latest release you found at http://nodejs.org/dist/latest/

wget http://nodejs.org/dist/latest/node-v0.10.17-linux-arm-pi.tar.gz

Uncompress it:

tar xvzf node-v0.10.17-linux-arm-pi.tar.gz

Copy it to your new directory:

sudo cp -r node-v0.10.17-linux-arm-pi/* /opt/node

Then add it to your environment variables by opening or creating .bash_profile in your home directory. (You nano if you can’t use vi.):

cd
vi .bash_profile

Add the following to your .bash_profile

PATH=$PATH:/opt/node/bin
export PATH

After saving the file, you’re all set!

Comments closed

Raspberry Pi Tip: Change keyboard layout

If you’re in the US like me and you start coding on your Raspberry Pi, you might quickly realize that when typing the pound key # you get the currency symbol: £

This is because the Raspberry Pi defaults to the British Keyboard layout. To change this, as sudo edit the file:

etc/default/keyboard

Change XKBLAYOUT=”gb” to XKBLAYOUT=”us”

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Then restart your Pi.

Comments closed