{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/545","labels_url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/545/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/545/events","html_url":"https://github.com/phonegap/phonegap-cli/issues/545","id":94296566,"number":545,"title":"Versioning & npm","user":{"login":"MethodGrab","id":2421069,"avatar_url":"https://avatars.githubusercontent.com/u/2421069?v=3","gravatar_id":"","url":"https://api.github.com/users/MethodGrab","html_url":"https://github.com/MethodGrab","followers_url":"https://api.github.com/users/MethodGrab/followers","following_url":"https://api.github.com/users/MethodGrab/following{/other_user}","gists_url":"https://api.github.com/users/MethodGrab/gists{/gist_id}","starred_url":"https://api.github.com/users/MethodGrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MethodGrab/subscriptions","organizations_url":"https://api.github.com/users/MethodGrab/orgs","repos_url":"https://api.github.com/users/MethodGrab/repos","events_url":"https://api.github.com/users/MethodGrab/events{/privacy}","received_events_url":"https://api.github.com/users/MethodGrab/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-10T12:19:57Z","updated_at":"2015-09-24T22:22:56Z","closed_at":"2015-07-20T19:41:33Z","body":"Node: `0.12.7`\r\nnpm: `2.13.0`\r\n\r\n**The problem**\r\nWhen installing `phonegap-cli` from npm with the command `npm install -g phonegap`, as specified in the [docs](http://docs.phonegap.com/getting-started/1-install-phonegap/cli/), a very old version is installed (`0.9.4`).\r\n\r\nThis is a problem for many reasons but the first one I encountered was the demo app created with `phonegap create ./my-app` tried to load the old `phonegap.js` which didnt exist instead of the newer `cordova.js`. This meant the demo app didn't work, which was confusing for someone new to phonegap like myself!\r\n\r\n**The reason**\r\nnpm considers versions with dashes as [pre-releases](https://github.com/npm/npm/issues/8672#issuecomment-115305000) and doesn't install pre-releases unless explicitly requested. The latest version of `phonegap-cli` on npm is `5.1.1-0.29.0` so by default npm installs the last release considered stable by sever which is `0.9.4`\r\n\r\n**The solution**\r\nEither adopt semver as your versioning standard if you plan on continuing to use npm to distribute the cli, or update the docs to suggest installing with `npm install -g phonegap@latest` which will pull the latest \"pre-release\" build.\r\n\r\n/ping: @Annonomus-Penguin, https://github.com/phonegap/phonegap-cli/issues/541 & https://github.com/npm/npm/issues/8672\r\n\r\n---\r\n\r\n**Update:**\r\nThis seems to be related to https://github.com/npm/npm/issues/8696, if you run `npm install -g phonegap` on `node@0.10.36` / `npm@1.4.28` it installs `phonegap@5.1.1-0.29.0` as expected."},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/comments/143065523","html_url":"https://github.com/phonegap/phonegap-cli/issues/545#issuecomment-143065523","issue_url":"https://api.github.com/repos/phonegap/phonegap-cli/issues/545","id":143065523,"user":{"login":"mwbrooks","id":21328,"avatar_url":"https://avatars.githubusercontent.com/u/21328?v=3","gravatar_id":"","url":"https://api.github.com/users/mwbrooks","html_url":"https://github.com/mwbrooks","followers_url":"https://api.github.com/users/mwbrooks/followers","following_url":"https://api.github.com/users/mwbrooks/following{/other_user}","gists_url":"https://api.github.com/users/mwbrooks/gists{/gist_id}","starred_url":"https://api.github.com/users/mwbrooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwbrooks/subscriptions","organizations_url":"https://api.github.com/users/mwbrooks/orgs","repos_url":"https://api.github.com/users/mwbrooks/repos","events_url":"https://api.github.com/users/mwbrooks/events{/privacy}","received_events_url":"https://api.github.com/users/mwbrooks/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T22:22:56Z","updated_at":"2015-09-24T22:22:56Z","body":"@austinarchibald glad it helped! I think your question is best asked on the [PhoneGap Google Groups](https://groups.google.com/forum/#!topic/phonegap/) since it's quite a common scenario."}}