Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
With this example package.json in an empty dir:
{
"private": true,
"name": "test",
"version": "0.0.0",
"scripts": {
"prepack": "echo prepack!",
"postpack": "echo postpack!"
}
}
and run npm pack --dry-run. You should see the following output, which appears in npm < 9:
> foo@0.0.0 prepack
> echo prepack!
prepack!
> foo@0.0.0 postpack
> echo postpack!
postpack!
npm notice
npm notice 📦 foo@0.0.0
npm notice === Tarball Contents ===
npm notice 234B package.json
npm notice === Tarball Details ===
npm notice name: foo
npm notice version: 0.0.0
npm notice filename: foo-0.0.0.tgz
npm notice package size: 236 B
npm notice unpacked size: 234 B
npm notice shasum: ba4102210bf70a017cd510276f01cc0c4b5f68d0
npm notice integrity: sha512-/s4lXyjWKoW7y[...]adUe23zB6HEkw==
npm notice total files: 1
npm notice
foo-0.0.0.tgz
However, in npm >= 9.0, i get this output:
npm notice
npm notice 📦 foo@0.0.0
npm notice === Tarball Contents ===
npm notice 234B package.json
npm notice === Tarball Details ===
npm notice name: foo
npm notice version: 0.0.0
npm notice filename: foo-0.0.0.tgz
npm notice package size: 236 B
npm notice unpacked size: 234 B
npm notice shasum: ba4102210bf70a017cd510276f01cc0c4b5f68d0
npm notice integrity: sha512-/s4lXyjWKoW7y[...]adUe23zB6HEkw==
npm notice total files: 1
npm notice
foo-0.0.0.tgz
Expected Behavior
npm 9+ doesn't suppress output in prepack/postpack scripts (and more broadly, in any lifecycle script that wouldn't be shown to a user who runs npm install/npm ci such that this project is installed (meaning, my own postinstall/preinstall/prepare scripts should always show output, but nobody else's should)
Steps To Reproduce
see above
Environment
- npm: 10.1.0
- Node.js: 20.5.1
- OS Name: Mac OS
- System Model Name: Macbook Pro
- npm config: n/a as long as
ignore-scripts isn't set
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
With this example
package.jsonin an empty dir:{ "private": true, "name": "test", "version": "0.0.0", "scripts": { "prepack": "echo prepack!", "postpack": "echo postpack!" } }and run
npm pack --dry-run. You should see the following output, which appears in npm < 9:However, in npm >= 9.0, i get this output:
Expected Behavior
npm 9+ doesn't suppress output in prepack/postpack scripts (and more broadly, in any lifecycle script that wouldn't be shown to a user who runs
npm install/npm cisuch that this project is installed (meaning, my own postinstall/preinstall/prepare scripts should always show output, but nobody else's should)Steps To Reproduce
see above
Environment
ignore-scriptsisn't set