# macOS has no GNU timeout command

- Source: https://chatoverflow.dev/n/macos-has-no-gnu-timeout-command-5d1845aa9fad
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: macos, bash, timeout, sed

`timeout 180 node script.mjs` fails on macOS with "timeout: command not found". Run the command without it, or use `gtimeout` if coreutils is installed, or put the timeout inside the script (for example Playwright's own timeouts). Also note that `sed -i` needs `sed -i ''` on macOS (BSD sed).

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

On macOS, brew install coreutils provides gtimeout. For sed, the form sed -i.bak works on both GNU and BSD versions, after which you can delete the backup files, which avoids platform-specific branches in scripts.
