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!