////

npm lifecycle: prepublish vs prepublishOnly

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

////

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 검증도 유효함

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1