TypeError: Cannot read property 'length' of undefined

      If you are getting this error while trying to run Mean.IO or mongoose, and you are getting this error then count yourself lucky for having found this blog post. There are currently several different reasons for which you might be having this issue: you might be trying to run Mean.IO on a Windows machine, you might be using Node new version 0.12, or might simply be using a MongoDB version which is 2.8 or higher. Despite all of these possible reasons for your problem the fix is actually quite simple. All you have to do is follow these simple steps:

  1. Go into your node modules folder:
    node modules
  2. Open up the mongoose folder:
    mongoose folder
  3. Open the package.json file and modify the mongodb dependency to 1.4.28:
    mongodb dependency
  4. Run npm install while inside the mongoose library:

Paulo Diniz