Skip to content

Prompt pack install can select a transitive dependency instead of the requested package #6093

Closed

Description

@Afloat16

Problem

The pack installer chooses the newest node_modules directory by mtime. A newer dependency can be mistaken for the requested package, causing a false missing-pack error or silently installing a different pack from that dependency.

Reproduction

At master 541cf26, install a real local npm tarball whose dependency gives its directory a later mtime in postinstall. With no bili-pack.json the dependency causes rejection; with a decoy bili-pack.json the wrong pack is installed. Actual npm installs reproduce both: 6 passed / 2 failed on the base.

Expected

Have npm record the direct dependency in the isolated temporary manifest and resolve that single dependency. Remove timestamp-based package identity guessing. Existing validation and atomic destination writes remain intact.

Prior work

Screened all 3,221 cached upstream PRs. #5342 introduced this installer and its directory-mtime heuristic. No historical fix addresses requested-package versus dependency selection. Previous Afloat16 PRs #6046–#6055 are excluded.

Activity

  1. ranxianglei commented on Nov 12, 2026

    @ranxianglei
    Owner

    Fixed in batch PR #6439 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions