I am a beginner to Linux. I am using 14.04 Ubuntu. When I tried to install node I found a -g flag which says that if you install with it, it can be accessed globally.
So I tried to install nodejs and npm without typing -g flag in the command
I ran these commands
cd /projects/basics
sudo apt-get install npm
sudo apt-get install nodejs
When I moved to the root folder using the cd command and checked npm --version and node --version it shows the corresponding versions.
So what's the need of the -g flag?