Twitter: raymondcamden


Address: Lafayette, LA, USA

How do you check (and update) your PhoneGap version in 3.0?

09-05-2013 12,822 views Mobile, JavaScript, HTML5 12 Comments

A tip of the rage wolf to fellow Adobian Brian Leroux for his help with this blog post. And by help, I mean he basically explained it all to me and I'm just making it pretty.

One of the big changes to PhoneGap 3.0 is in how you install it. Previously you would download a zip file, expand it, and have all the bits you need. Now the installation process has you use npm (Node Package Manager) to grab the bits.

I've been using Node and npm for a while, but I'm definitely still a bit unsure of how it works. The question I had was - how would I be able to tell when a new version was released and how would I get my copy updated?

First, remember that the phonegap CLI has a -v argument that tells you the current version you have installed:

Currently the PhoneGap site only mentions 3.0 and not anything more specific, so to compare your version to the latest in npm, you would do "npm info phonegap version". This is demonstrated below:

In this case, my version is the same, but if I wanted to update, I'd run: npm update -g phonegap. I always use sudo in front but you may not have to do that (especially on Windows ;).

Hope this helps. Tomorrow morning I'll be blogging about how plugins have changed.

12 Comments

  • abada #
    Commented on 09-06-2013 at 2:07 AM
    thanks for helpful information.
  • Commented on 09-14-2013 at 1:20 AM
    Using node.js to install phonegap is confusing, you should go back to a regular
    package in a zip file. The npm folder where phonegap gets installed is in the
    C:\Users\my\AppData\Roaming or maybe the AppData local folder for some.

    The Phonegap build folder for cloud should come as a seperate installation

    I had phonegap build phonegap this and that in the npm folder and in the npm cache folder. There was also different android files and folders in all of them.

    Kind of reminds me of some Zend folders that I was using that were 14 levels deep just to store one .css file or one flower picture. Personally I would rather find and search through a few folders for multiple files than get lost in a 2000 folders, 20 levels deep MVC Node framework; too me that is the 9th circle of Hell

    There is way way too much ambiguity in the folder directory traversal with node.js and phonegap. Here is an example in windows 7

    C:\Users\me\AppData\Roaming\npm\nodemodules\phonegap\nodemodules
    \cordova\nodemodules\npm\nodemodules\read-installed\test

    The way that everything is stored and personally navigating between all these hundreds of folders makes me as a developer want to put a Gun in my Mouth!!
  • Commented on 09-14-2013 at 8:04 AM
    Ryan, you posted the exact same comment on two blog posts. That was not necessary. I'll reply more to the other one.
  • Jasper #
    Commented on 09-27-2013 at 5:02 AM
    i don't think I have phonegap installed

    this is what it showed in the last 2 lines of nom

    npm ERR! cb() never called!
    npm ERR! not ok code 0

    when i tried phonegap -v:
    -bash: phonegap: command not found
  • Commented on 09-27-2013 at 7:40 AM
    @Jasper: Best I can suggest is to try install phonegap again via npm.
  • Carlos #
    Commented on 02-13-2014 at 9:01 AM
    Hi Raymond! I got some issues on Phonegap 3.3, can I revert the Phonegap version to previous 3.2?
  • Commented on 02-13-2014 at 9:04 AM
    I believe so. I'd check the npm docs. I think there is a way to grab previous versions.
  • Nikki #
    Commented on 04-19-2014 at 10:58 AM
    Hi Raymond. Glad I found you. I am beyond an embryo at all of this. I have phonegap installed and was informed to upgrade. followed instructions and believe it is but when I log on it still say upgrade. In my terminal this shows:

    phonegap -v
    3.4.0-0.19.17

    is there something else i am to do after this? thanks in advance.
  • Commented on 04-19-2014 at 2:43 PM
    That is the most recent version. You say, "when you logon..." - what do you mean by that?
  • NIkki #
    Commented on 04-21-2014 at 8:09 AM
    When I log in to phone gap direct from on the website. It says your app is not currently utilizing the newest version. The connection isn't being made. I use dreamweaver to build and phone gap for emulator.
  • Commented on 04-21-2014 at 8:26 AM
    Nikki, you are talking about PhoneGap Build. You didn't make that very clear. PGB is telling you that the app you uploaded, at some time in the past, is now using an older version. You can - normally - ignore this. If tomorrow we release 4.0 on PGB, then your apps will be marked as using an older version. This is normal.

    As to your second thing, "connection isn't being made" - I have no idea what you mean there. Perhaps you can clarify?
  • Martin Cisneros #
    Commented on 04-26-2014 at 12:20 AM
    Thank you very much!

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty