Package manager is tool for software developer to install,
publish and manage dependecies.
Just like other widely used programming languages, nodejs
has its own package manager –
In this blog, I’m going to set up AngularJS develoment environment with
But before that I have to set up
npm on my machine.
npm can be as easy as grabbing package from
nodejs. However there are other ways to install.
For instance, command line
or other package managers. After npm is successfully installed,
we can check it.
npm is included in the latest node package.
Next, we want to install Yeoman, Grunt and Bower
by using npm. But before that, I need to alter permission
of some files on my system to prevent the infamous
Please try running this command again as root/Administrator error.
Of course I can avoid this error by using
sudo npm install package
but this is not the recommended way.
Instead, I’ll just use
chown to change permission of
By this way some error will be eliminated BUT this might not be enough. In some case, there will be other permission issue of other directory. This is the error I get when I first install npm.
1 2 3 4 5 6 7
Yes, I do not have ownership permission on my
/.npm/ folder which
is located in my home directory. Here is a solution from stack overflow.
In this case system will automatically substitude username into the whomi.
~ indicates home directory path.
After this we should be fine to set up Angular JS environment.
I’ll install Yeoman, Grunt and Bower globally by this command.
Ok let’s get Angular JS set up. This can be done easily by using Yeoman.
1 2 3 4
This will create a new folder
angularapp and scaffold a new AngularJS
application in current folder.
Ok, done for environment. We can start to ng right now.
To use grunt as server, we also have to install the latest version of Grunt in project folder, and add it to devDependencies.
Also we need to do the same thing to enable karma.
1 2 3
jasmine is my testing framework and I am