Unmet peer dependencies not listed for production install

I have an issue with unmet peer dependencies not being listed when doing a production install. In my instance, one of my required peer dependencies is also listed as a dev dependency.

Take the following simple dependency tree:

    "dependencies": {
        "grunt-steroids": "^1.2.0"
    }

In this instance, ‘grunt-steroids’ has a peer dependency on grunt version 0.4.5. If I don’t list grunt as a devDependency and do a standard npm install I get a warning that I have an unmet peer dependency, as I should.

However, as my module has a devDependency on grunt, my tree looks like this:

  "dependencies": {
    "grunt-steroids": "^1.2.0"
  },
  "devDependencies": {
    "grunt": "0.4.5"
  }

Running an npm install works here - the devDependency gets included and everything is fine. However, if I do a production npm install, grunt does not get included as it is listed as just a peer dependency. In this instance, I do not get a warning that I have an unmet peer dependency, despite the required packages not being installed.

I’m unsure if this is a bug or a misunderstanding, but it feels to me that a production build should take into account dev dependencies not being included when determining if peer dependencies are met.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.