Update Node.js on Mac OS

Well for quite sometime I was using Node v 0.12x on my system, whereas nodejs has been updated to 7.x till date
I thought I used the right commands but the updates were never reflected

Gladly, I found this article on web.

I am writing down the steps that worked for me (it seems XAMPP on mac adds on some steps to the installation procedure) :

A simple way to upgrade Node.js from the Terminal is to use the n version manager:

1 npm install -g n
2 npm cache clean -f

Now, if you have XAMPP installed on your Mac, you need to do an extra step before upgrading Node.js:

1 cd /Applications/XAMPP/xamppfiles/bin
2 sudo mv HEAD _HEAD

At this point upgrading Node.js is as simple as:

1 sudo n stable
2 npm update -g

For XAMPP users only, rename _HEAD back to the original HEAD:

1 cd /Applications/XAMPP/xamppfiles/bin
2 sudo mv _HEAD HEAD

You can check which versions of npm and Node.js you have on your system with:

1 node -v
2 npm -v

Cheers!

Diving into Angular JS – Installation Windows 8

So this time its Angular JS, something new I am trying to learn

The current instructions are for installing angularJS on Windows 8/8.1 platform (may also work on windows 7, however not tested)

Dependencies Installation :
I had some of the dependecies already installed like Git, Java, Node.JS.

We will be using Grunt as our build system. For installing Grunt :

npm install -g grunt-cli

We will be using Bower to manage client-side packages for the docs. For installing Bower :

npm install -g bower

 

Then I forked the github account at https://github.com/angular/angular.js

 

Building AngularJS

To build AngularJS, you clone the source code repository and use Grunt to generate the non-minified and minified AngularJS files:

Open command prompt with administrator privileges (right click, run as Administrator)(Note: This is because grunt package creates some symbolic links)

# Clone your Github repository:
git clone "git@github.com:<your-github-username./angular.js.git"

# Go to the AngularJS directory:
cd angular.js

# Add the main AngularJS repository as an upstream remote to your repository:
git remote add upstream "https://github.com/angular/angular.js.git"

# Install node.js dependencies:
npm install

# Install bower components:
bower install

# Build AngularJS:
grunt package

 

 

Installing a specific version of Cordova

With the recent releases and compatibility issues with the plugins we have to switch to some particular version of Cordova/Phonegap which works stable for our exisiting projects. However I was having issue in finding the exact version no to which I need to re-install.

Using command line we can see the versions of cordova available by

npm view cordova versions

The output is like :

C:\Users\upasana>npm view cordova versions

[ '0.0.0-fake',
'0.0.1',
'0.0.2',
'0.0.3',
'0.0.4',
'0.0.5',
'0.0.6',
'0.0.7',
'0.0.8',
'0.0.9',
'0.1.0',
..............
..............
'4.0.0',
'4.0.1',
'4.1.0',
'4.1.1',
'4.1.2',
'4.1.3-nightly.2014.10.21',
'4.2.0',
'4.3.0',
'4.3.1',
'5.0.0',
'5.1.1' ]

 

Then to install a particular version we use the following command.

npm install -g cordova@4.2.0

Have a great day!