Note:
Use npm >= 11.6.3 to avoid (these) issues!
More info in this comment: #8535 (comment)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Discovered here: electron-userland/electron-builder#9259
A clean npm install produces different results on the first and second run.
Expected Behavior
npm install should produce the same results each time.
Steps To Reproduce
On mac, ignoring scripts just in case:
npm install -g npm@latest
mkdir test && cd test
npm init -y
npm install --ignore-scripts @abandonware/noble
# added 156 packages, and audited 157 packages in 972ms
npm install --ignore-scripts
# changed 12 packages, and audited 157 packages in 542ms
The second install shows "changed 12 packages" which is unexpected. This is also reproducible installing from package/lock files.
rm -rf node_modules
npm install --ignore-scripts
# added 156 packages, and audited 157 packages in 1s
npm install --ignore-scripts
# changed 12 packages, and audited 157 packages in 553ms
The different results are visible in the FS by diffing the output of find node_modules before and after.
Environment
- npm: 11.5.2
- Node.js: v22.14.0
- OS Name: MacOS
- System Model Name: Macbook Pro M4
- npm config:
; node bin location = /Users/liam.mitchell/.local/share/fnm/node-versions/v22.14.0/installation/bin/node
; node version = v22.14.0
; npm local prefix = /Users/liam.mitchell/npm-install
; npm version = 11.5.2
; cwd = /Users/liam.mitchell/npm-install
; HOME = /Users/liam.mitchell
Note:
More info in this comment: #8535 (comment)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Discovered here: electron-userland/electron-builder#9259
A clean
npm installproduces different results on the first and second run.Expected Behavior
npm installshould produce the same results each time.Steps To Reproduce
On mac, ignoring scripts just in case:
The second install shows "changed 12 packages" which is unexpected. This is also reproducible installing from package/lock files.
The different results are visible in the FS by diffing the output of
find node_modulesbefore and after.Environment