Skip to content

[Bug] yarn not ignoring optional dependencies when they are not found #2425

@ShirMon

Description

@ShirMon
  • I'd be willing to implement a fix

Describe the bug

Wasn't sure if this is considered a bug or a missing feature, when adding optional dependencies in the package.json file yarn will fail installation if the dependency is not found while with npm it skips the optional dependency when not found.

To Reproduce

Add a non existing optional dependency to package,json:
"optionalDependencies": {
"thispackagedoesntexist": "^1.0.0"
}

Screenshots

With optional dependencies:
image

Without:
image

Environment if relevant (please complete the following information):

  • OS: Linux
  • Node version v14.14.0
  • Yarn version 2.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions