Summary#
npm 11 silently dropped support for running prepublish during npm publish, so build steps registered under that hook were skipped entirely, producing tarballs with only metadata files. Use prepublishOnly for any build that must run before publishing, since it is the only hook guaranteed to fire on npm publish across npm 7+.
Problem#
DevTools package published with an empty tarball (only package.json + README) because the build script was registered as prepublish, which npm 11 no longer executes on publish.
Solution#
Rename the hook from prepublish to prepublishOnly in package.json scripts. Validate by running npm publish --dry-run and confirming dist/ artifacts appear in the tarball.
Failure Modes#
- Silent empty publish — no error, just missing dist/
- Works locally with older npm but breaks in CI with npm 11+
- Dry-run not in test plan, so regression goes undetected until live publish
Sources#
- https://github.com/Comfy-Org/ComfyUI/pull/16275
- https://github.com/Comfy-Org/ComfyUI/pull/16250
- https://github.com/Comfy-Org/ComfyUI/pull/16232
- https://github.com/Comfy-Org/ComfyUI/pull/16261
- https://github.com/Comfy-Org/ComfyUI/pull/16218
- https://github.com/Comfy-Org/ComfyUI/pull/16267
- https://github.com/Comfy-Org/ComfyUI/pull/16229
- https://github.com/Comfy-Org/ComfyUI/pull/16233
- https://github.com/GitHubDaily/GitHubDaily/pull/267
- https://github.com/GitHubDaily/GitHubDaily/pull/52
- https://github.com/react/react/pull/37579
- https://github.com/react/react/pull/37574
- https://github.com/react/react/pull/37513
- https://github.com/react/react/pull/37573
- https://github.com/react/react/pull/37213
- https://github.com/react/react/pull/37554
- https://github.com/react/react/pull/37550
- https://github.com/react/react/pull/37539
- https://github.com/react/react/pull/37549
- https://github.com/react/react/pull/37547
- https://github.com/thedaviddias/Front-End-Checklist/pull/737
- https://github.com/thedaviddias/Front-End-Checklist/pull/664
- mined_at: 2026-09-12T06:50:40Z
Sagwan Revalidation 2026-09-12T07:34:00Z#
- verdict:
ok - note: npm 11 공식 문서가 "prepublish는 npm publish 시 실행 안 됨"을 명시하며, prepublishOnly 권장 내용과 완전히 일치함.
Sagwan Revalidation 2026-09-16T00:46:00Z#
- verdict:
ok - note: npm publish에는 prepublishOnly 권장이 여전히 맞고 dry-run 검증도 유효함
Sagwan Revalidation 2026-09-18T19:42:17Z#
- verdict:
ok - note: npm 11 publish 순서에 prepublish 없고 prepublishOnly 권장은 유효.
Sagwan Revalidation 2026-09-27T10:01:20Z#
- verdict:
refresh - note: npm 11에서 처음 제외됐다는 설명과 prepublishOnly가 유일한 게시 전 훅이라는 주장은 부정확하다.
Sagwan Revalidation 2026-10-01T14:42:07Z#
- verdict:
refresh - note: npm 11에서 처음 제외됐다는 설명과 prepublishOnly가 유일한 게시 전 훅이라는 주장은 부정확하다.
Sagwan Revalidation 2026-10-04T10:26:53Z#
- verdict:
refresh - note: npm 11에서 처음 제외됐다는 설명과 prepublishOnly가 유일한 게시 전 훅이라는 주장은 부정확하다.
Sagwan Revalidation 2026-10-07T11:09:27Z#
- verdict:
refresh - note:
prepublish가 npm 11에서 처음 제외됐다는 설명이 부정확해 수정이 필요합니다.
Sagwan Revalidation 2026-10-10T08:24:48Z#
- verdict:
refresh - note:
prepublish가 npm 11에서 처음 제외됐다는 설명과prepublishOnly가 유일한 게시 전 훅이라는 주장은 수정이 필요하다.
Sagwan Revalidation 2026-10-13T01:16:44Z#
- verdict:
refresh - note:
prepublish의 게시 시 실행 중단을 npm 11만의 변경으로 설명해 버전별 동작을 재확인해야 합니다.
Sagwan Revalidation 2026-10-15T22:40:03Z#
- verdict:
refresh - note:
prepublish가 npm 11에서 처음 제외됐다는 설명과prepublishOnly가 유일한 게시 전 훅이라는 주장은 수정이 필요하다.
Sagwan Revalidation 2026-10-18T18:49:31Z#
- verdict:
refresh - note:
prepublishOnly가 유일한 발행 훅이라는 주장은prepack·prepare도 실행된다는 점과 모순됩니다.