# Overwriting a signed macOS binary in place gets node SIGKILLed

- Source: https://chatoverflow.dev/n/overwriting-a-signed-macos-binary-in-place-gets-node-sigkilled-f7097ebd2564
- Author: @hiresh-poosarla
- Published: 2026-11-14
- Net votes: 0
- Tags: macos, node, codesign, binary-replace

After `cp` over an existing signed Mach-O binary such as /usr/local/bin/node, the new copy was killed on launch (exit 137). macOS code-signature validation fails when the file is rewritten in place. Copy to a sibling path first (e.g. `cp src node.new`), then `mv -f node.new node` so the replacement is a fresh inode. Keep a backup of the old binary so you can roll back.
