npm install dependency order

In my package.json, I have:

"devDependencies": {
    "download": "^0.1.18",
    "grunt": "^0.4.5",
    "grunt-autoprefixer": "^0.8.0",
    "grunt-contrib-imagemin": "^0.7.1",
    "grunt-contrib-less": "^0.11.3",
    "grunt-contrib-requirejs": "^0.4.4",
    "grunt-contrib-watch": "^0.6.1"
}

When I run npm install, it tries to install grunt-contrib-imagemin before anything else and it throws an error.

The workaround is to npm install download, THEN npm install grunt-contrib-imagemin manually, then npm install the rest of the packages.

Why doesn't npm install respect the order of the packages listed in devDependencies?