One of the best parts about Node.js is npm.

I recently inherited a code base where the version for all the dependencies was set to latest. Getting the latest version of all the dependencies sounds like a cool idea, until you realize the latest version of Express (4.0 at the time of this post) no longer comes bundled with the body-parser module and if your app relied on that, it will not run.

// Don't do this:

{
  "name": "module-name",
  "description": "My module",
  "dependencies": {
    "express": "latest",
    "mongojs": "latest"
  }
}

// Do this instead:

{
  "name": "module-name",
  "description": "My awesome module",
  "dependencies": {
    "express": "3.3.x",
    "mongojs": "1.2.1"
  }
}

You can see a full list of the semantic versioning syntax that is supported by npm and test out the various options, but try to keep it simple, one day someone like me will have to work with it.



Follow my thoughts, checkout projects that interest me, connect with me professionally or send me an old fashioned email.