How to ensure correct ionic / cordova version is used?


I’m trying to find the best way to make sure all the developers working on the Ionic App project are using the same version of Ionic and Cordova. In other words I want something like this

  1. I specify a required version of Cordova and Ionic for the project
  2. My co-worker clones the repo and runs ionic build
  3. If he has versions of Cordova or Ionic installed that differ from what is required then he has an error in command line.

I haven’t found any clue so far on how to achieve that. Can anybody jump in and suggest how to achieve that?

Here is what I’m thinking of:

  1. Installing Ionic and Cordova locally and track them in git repo. Though local installation will make us troubles in using CLI (since no global installation)
  2. Specifying version dependencies in package.json. However I haven’t found what would be a correct place to put them (devDependencies?)