Install NodeJS and Bower on Ubuntu 12.04 Precise

April 29th, 2014

Warning: This post is 9 years old. Some of this information may be out of date.

I'm using Bower on a few projects at work to manage the JavaScript dependencies and it works perfectly for my needs. The only issue is that the websites are currently deployed on Ubuntu 12.04 and the packaged version of NodeJs is too old to install Bower.

The solution is to install Bower and NodeJS on Ubuntu 12.04 using the PPA provided by Chris Lea:

    sudo add-apt-repository ppa:chris-lea/node.js 
    sudo apt-get update
    sudo apt-get -y install nodejs

When this has installed, check the version:

    npm --version
    1.4.3

Now install Bower:

    sudo npm install -g bower

This will fetch and install Bower globally.