Skip to content

[BUG] omit=peer causes bin creation to be skipped if matches name of a peer dep #8373

Open
@kellyselden

Description

@kellyselden

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I have a case where https://github.com/CrowdStrike/commitlint/ has a bin of commitlint, but also has a dependency on commitlint-format-junit, which has a peerDependency on the npm package named commitlint. When adding @crowdstrike/commitlint to a repo like https://github.com/kellyselden/move-semver-tags-action, the peer dep wins over the conflicting bin name. That is fine, but when I add omit=peer kellyselden/move-semver-tags-action#177, it also skips the bin name of commitlint from @crowdstrike/commitlint. I have to use the full path to commitlint to get it to work kellyselden/move-semver-tags-action#180. The current state is this revert PR kellyselden/move-semver-tags-action#181 that brings back a call to commitlint while having omit=peer will fail to find commitlint because of the naming conflict.

Expected Behavior

Adding omit=peer should ignore the peerDependency of commitlint, but preserve any commitlint bins from any other dependencies.

Steps To Reproduce

Check out https://github.com/kellyselden/move-semver-tags-action to see no commitlint bin in node_modules, even though it has a dependency on @crowdstrike/commitlint which exposes that bin. This is because it has omit=peer set, and there is a peerDependency with that same name in the graph.

Environment

  • npm: 11.4.2
  • Node.js: v22.16.0
  • OS Name: Win 10
  • System Model Name: PC
  • npm config:
engine-strict = true
include = []
omit = ["peer"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions