Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

missing peerDependencies prevent one from creating shrinkwrap in npm 3 #12909

@mgol

Description

@mgol

I thought npm 3 was supposed to solve all peerDependencies problems by always warning if they're missing but otherwise not breaking. Unfortunately, even with npm 3.9.3, npm shrinkwrap will still fail if a peerDependency is missing. For example, with the following package.json:

{
  "name": "test",
  "dependencies": {
    "jquery-placeholder": "2.3.1"
  }
}

Running npm install & then npm shrinkwrap results in an error:

npm ERR! Darwin 15.5.0
npm ERR! argv "/Users/mgol/.nvm/versions/node/v6.2.0/bin/node" "/Users/mgol/.nvm/versions/node/v6.2.0/bin/npm" "shrinkwrap"
npm ERR! node v6.2.0
npm ERR! npm  v3.9.3

npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! peer invalid: jquery@*, required by jquery-placeholder@2.3.1
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mgol/_/npm-debug.log

and no shrinkwrap is created.

I'd expect npm to only warn in such a case as well.

Is there any way to generate shrinkwrap with missing peerDependencies in npm 3?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions