Skip to content

Dependencies listed in ignoredBuiltDependencies still trigger warnings after pnpm rebuild #9338

@unekinn

Description

@unekinn

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

10.7.0

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/unekinn/pnpm-ignored-built-dependencies-bug

Reproduction steps

  1. Clone the repo:
    git clone [email protected]:unekinn/pnpm-ignored-built-dependencies-bug.git

  2. Enter the repo:
    cd pnpm-ignored-built-dependencies-bug

  3. Run pnpm i

    Lockfile is up to date, resolution step is skipped
    Packages: +7
    +++++++
    Progress: resolved 7, reused 7, downloaded 0, added 7, done
    
    devDependencies:
    + @swc/core 1.11.13
    + esbuild 0.25.1
    + just-pnpm 1.0.2
    
    Done in 275ms using pnpm v10.7.0
    
  4. Run pnpm rebuild

    node_modules/.pnpm/[email protected]/node_modules/just-pnpm: Running preinstall script, done in 131ms
    node_modules/.pnpm/[email protected]/node_modules/just-pnpm: Running postinstall script, done in 111ms
    
  5. Run pnpm i again

    Lockfile is up to date, resolution step is skipped
    Already up to date
    
    ╭ Warning ───────────────────────────────────────────────────────────────────────────────────╮
    │                                                                                            │
    │   Ignored build scripts: @swc/core, esbuild.                                               │
    │   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.   │
    │                                                                                            │
    ╰────────────────────────────────────────────────────────────────────────────────────────────╯
    
    Done in 241ms using pnpm v10.7.0
    

Describe the Bug

"Ignored build scripts" (ignoredBuiltDependencies) config is not respected after running pnpm rebuild. This is especially severe when using strict-dep-builds=true in .npmrc (not enabled in the reproduction)

Expected Behavior

I expect no warning for build scripts in dependencies listed under ignoredBuiltDependencies when running pnpm install after pnpm rebuild

Which Node.js version are you using?

22.14.0 (also tested with 20.12.1)

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions