Is there an existing issue for this?
This issue exists in the latest npm version
This is not just 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
- Create a clean project
- Add
install-strategy = "linked" to the .npmrc
- Install
esbuild
- Run
npm install-scripts approve esbuild
- 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.
Is there an existing issue for this?
This issue exists in the latest npm version
This is not just a request to bump a dependency for a CVE
Current Behavior
When using
install-strategy=linkedand adding a package toallowScriptsI 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
install-strategy = "linked"to the.npmrcesbuildnpm install-scripts approve esbuildallowScriptsinpackage.jsonEnvironment