Ubuntu initial setup (14.04)

I believe “node” is reserved word for terminal in ubuntu, so when you install node through package manager (apt-get) it saves command as “nodejs” not “node” which causes issues with new cli tools installed via npm command since they are looking for “node” command.

You need to symlink it through following command:
ln -s /usr/bin/nodejs /usr/bin/node

Also, originally npm command require “sudo” to install new packages.
You can avoid this by doing following:

npm config set prefix '~/.npm-packages'

You also need to ad following to ~/.bashrc file

export PATH="$PATH:$HOME/.npm-packages/bin"

This is taken from http://stackoverflow.com/questions/19352976/npm-modules-wont-install-globally-without-sudo

and

https://github.com/joyent/node/issues/3911

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s