in Tips

Getting Yeoman to Work On Ubuntu

One of more popular front end development inventions is the Yeoman scaffolding tool. It has created a buzz on the Internet – for all the good reasons. Yeoman is adept to minifying your style sheets and scripts, as well as scaffolding out an Angular project fast. Think of Yeoman as a jolly little man living inside your command tool, awaiting your requests. For the record, Yeoman is a catch-all phrase for Grunt (automa­tion), Bower (pack­age man­ager), and Yo (scaffolder).

In the official repositories of Ubuntu 14.04, versions 0.10.x of NodeJS are present. But when you try node command in terminal you don’t actually get NodeJS. NodeJS is actually available using nodejs command. So, to setup Yeoman on Ubuntu you need to initially install NodeJS legacy package with apt-get package manager, which is very easy.

First type:

sudo apt-get install nodejs-legacy npm

Because Yeoman depends on ‘node’ legacy binary during installation, npm alone is not really sufficient for installation. That is why you require nodejs-legacy package first.

Install Ruby tools on Ubuntu

Debian GNU/Linux and Ubuntu use the apt package manager. You can use it like this:

sudo apt-get install ruby-full

As of writing, the ruby-full package provides Ruby 1.9.3, which is an old stable release, on Debian and Ubuntu.

Install global npm packages as a regular user

In Ubuntu 14.04, npm installs packages under a ‘prefix’ configuration variable, which defaults to the /usr/lib folder path. This requires from you to use sudo whenever you want to install global npm package. But you can configure ‘prefix’ variable to a point into a user local directory, so as to avoid using sudo.

sudo npm set prefix '/home/yourusername/.npm' –global

Use this command to verify that the above setting has been set.

sudo npm get prefix

Update your $PATH variable to include the location npm installs binaries;

echo "export PATH=$PATH: $HOME/.npm/bin" >> $HOME/.profile

Then restart your terminal session.

Install Yeoman on Ubuntu

Installing from Yeoman this point is nothing but child’s play. Just type:

npm install -g yo

And voila! It is that simple.

To make certain that Yeoman tool has indeed installed successfully, you need to test it. The best way to do a test flight is by navigating into a specific directory – in your terminal – where you would like to start a new project and just type therein:


You will know the Yo installation was successful, when the menu of options including “install a generator” gladly pops up on your terminal. Select the latter “install a generator” option and then type in something like “Webapp”, “Less”, “Ember” or “Angular” at the command prompt. A plethora of generators will pop up. So, aptly choose one and patiently wait for it to install. Yo scaffolding tools are mostly generators, which you should consider as blueprints for your web projects.

If Yeoman, therefore, gets one of the generators it will provide necessary instructions needed to lay some groundwork for your web projects. To know whether Yeoman is working fine on Ubuntu , the installed generator will start pulling down some files with no any issues or errors.

Now you have everything you need to run Yeoman on Ubuntu.