Skip to content

[BUG] Verbose and duplicate entries in allowScripts created when install-strategy=linked #9939

Closed

Description

@nikolawork

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

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

When using install-strategy=linked and adding a package to allowScripts I get weird output:

{
	"allowScripts": {
		"file:../../../vue-demi@0.14.10-pGPQNZuy2Yfs8dw1nOAidw/node_modules/vue-demi": true,
		"file:../../../esbuild@0.28.2-5fSWMmpOnxTxpz8DaF55tQ/node_modules/esbuild": true,
		"file:../../esbuild@0.28.2-5fSWMmpOnxTxpz8DaF55tQ/node_modules/esbuild": true
	}
}

Expected Behavior

When not using a linked install strategy I get concise entries, without duplicates (see the difference for esbuild)

{
	"allowScripts": {
		"vue-demi@0.14.10": true,
		"esbuild@0.28.2": true
	}
}

Steps To Reproduce

  1. Create a clean project
  2. Add install-strategy = "linked" to the .npmrc
  3. Install esbuild
  4. Run npm install-scripts approve esbuild
  5. Look at the state of allowScripts in package.json

Environment

  • npm: 11.19.0
  • Node.js: 26.7.0
  • OS Name: macOS Sequoia 15.7.9
  • System Model Name: Macbook Pro
  • npm config:
; "user" config

; min-release-age = 14 ; overridden by project

; "project" config

install-strategy = "linked"
min-release-age = 14

; node bin location = /Users/name/.nvm/versions/node/v26.7.0/bin/node
; node version = v26.7.0
; npm local prefix = /Volumes/projects/project
; npm version = 11.19.0
; cwd = /Volumes/projects/project
; HOME = /Users/name
; Run `npm config ls -l` to show all defaults.

Activity

  1. nikolawork commented on Sep 1, 2026

    @nikolawork
    Author
  2. manzoorwanijk commented on Sep 1, 2026

    @manzoorwanijk
    Contributor

    Yes, I can reproduce it locally, and I am working on a fix. Thank you for reporting it.

  3. manzoorwanijk commented on Sep 1, 2026

    @manzoorwanijk
    Contributor

    #9941 should fix it. It would be great if you could help test it and verify the fix.

  4. nikolawork commented on Sep 1, 2026

    @nikolawork
    Author

    #9798 should fix it. It would be great if you could help test it and verify the fix.

    I think you mean #9941?

    Would love to help test. How can I install the version from your PR so I can test the fix?

  5. manzoorwanijk commented on Sep 1, 2026

    @manzoorwanijk
    Contributor

    I think you mean #9941?

    Yeah, that’s right. Sorry for the confusion.

    Would love to help test. How can I install the version from your PR so I can test the fix?

    Once you checkout the PR, you can replace npm in your commands with node <path/to/cloned/cli>

  6. added a commit that references this issue on Oct 1, 2026
    b317f16
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions