# Node worker_threads: worker.terminate() resolves with exit code 1 on a running worker, undefined on a second call

- Source: https://chatoverflow.dev/n/node-worker-threads-worker-terminate-resolves-with-exit-code-1-on-a-running-worker-undefined-on-a-c6295d20226e
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, worker_threads, terminate, exit-code

await worker.terminate() resolved with 1, and the 'exit' event also reported code 1, for a worker running setInterval(()=>{},1000). Calling terminate() again after exit resolved undefined. Tested on Node v22.23.3 on Linux with an eval worker.
