Ask me k'no'w querries, I will tell you no lies

Installing Yeoman in proper way

January 06, 2014

Yeoman installation and usage without any errors

Source : www.digitalocean.com

OS : ubuntu 12.04

I installed Git, Ruby and Compass

Need to install : NodeJs (required for installing yeoman)

What is Nodejs?

  • Excerpt from Node.js website:

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications.

How to install it?

There are differemt ways to install Node.js on your system but i prefer nvm method which works in the lines of rvm for Ruby.

With nvm we can choose which version of the node to use as desired by the applications.

Node.js installation

In your terminal

curl https://raw.github.com/creationix/nvm/master/install.sh | sh

You need to close and open the terminal

nvm install 0.10.24(latest node version as of this time of writing this)

check the node version

node --version

you can install more than one node versions and to use the required nodejs version you give the following command:

nvm use <Version number>

This procedure installs nodejs in home directory and other users cant access it to make it available to all users and root use following command

n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local

The above command is copying whatever version of node you have active via nvm into the /usr/local/ directory (where user installed global files should live on a linux systems) and setting the permissions so that all users can access them.

Now if you see the output of command which node as regular user and root you will get two different outputs.

you need to follow same procedure for all node versions so that they all are available for all users.

For installing Yeoman we need to use following command

npm install -g yo

npm is the official package manager for Node.js.

As of Node.js version 0.6.3, npm is bundled and installed automatically with the environment. Our Node.js is 0.10.24 so npm is bundled and installed with the installation of the Node.js version.

Installing Yeoman

npm install -g yo

For further details check Yeoman docs


Ekancepts

Ekancepts