Skip to content

npm updates are not shallow #2348

@felixfbecker

Description

@felixfbecker

What Renovate type are you using?
Renovate GitHub App

Describe the bug
This is npm behaviour, but I wanted to post it here to raise awareness and maybe see if Renovate can work around it, as it is especially unexpected for Renovate.

When updating a dependency pkg, Renovate will update all the dependencies of pkg to the latest version too, even though the expectation is that every package update is isolated. This brought us a bad bug in a transitive dependency recently when we thought we were just updating one of our private packages to include a tiny bug fix, but in reality it also updated the indirect dependencies (which is even hidden in the diff as package-lock gets collapsed by GitHub). This is especially bad when using automerge in certain packageRules, because the packageRule actually only applies to the top-level dependency, but indirect dependencies may be updated & automerged too.

I filed this on npm with additional details and repro steps: https://npm.community/t/impossible-to-update-single-package-without-updating-its-dependencies/1156

But knowing how busy the npm team is, I wonder if Renovate could work around this somehow, e.g. manually editing the lockfile to ensure indirect dependencies stay the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    manager:npmpackage.json files (npm/yarn/pnpm)priority-4-lowLow priority, unlikely to be done unless it becomes important to more peoplestatus:requirementsFull requirements are not yet known, so implementation should not be started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions