# Zkir returned non-zero exit status -4

**URL:** <https://forum.midnight.network/t/zkir-returned-non-zero-exit-status-4/1329>\
**Category:** General\
**Created:** [August 30, 2026, 7:28pm UTC](https://forum.midnight.network/t/zkir-returned-non-zero-exit-status-4/1329 "2026-08-30T19:28:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hughdownunda](https://avatars.discourse-cdn.com/v4/letter/h/a698b9/32.png) [@Hughdownunda](https://forum.midnight.network/u/Hughdownunda)\
**Post date:** [August 30, 2026, 7:28pm UTC](https://forum.midnight.network/t/zkir-returned-non-zero-exit-status-4/1329/1 "2026-08-30T19:28:08Z")

</div>

I need help. I have been trying to compile 5 smart contracts for weeks now so I can make my dApp(s) live on the Midnight network. After fixing every compilation error known all of my contracts now say the same thing. Zkir returned non-zero exit status -4. I have tried everything on docs.midnight.network as well as every suggestion from Google search, Gemini, Microsoft copilot and others. Can someone tell me what I am doing wrong or what I need to do to fix this please?

---

<div class="post-metadata">

**Author:** ![nasihudeenJ](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@nasihudeenJ](https://forum.midnight.network/u/nasihudeenJ)\
**Post date:** [August 31, 2026, 3:42pm UTC](https://forum.midnight.network/t/zkir-returned-non-zero-exit-status-4/1329/2 "2026-08-31T15:42:02Z")

</div>

Hey @Hughdownunda welcome, and sorry you’ve been stuck on this.

`Zkir returned non-zero exit status -4` usually means the **ZKIR proving-key step** failed, not that Compact still has a syntax/type error. Same `-4` on all five contracts usually points to the **toolchain/environment** (zkir binary blocked, bad install, arch mismatch, or low memory), not contract bugs.

Quick checks:

1. Try compiling with `--skip-zk`. If that succeeds, your contracts are fine and the failure is specifically in key generation.
2. Tell us your OS/arch and the output of `compact --version` and `compact compile --version`.
3. Paste the full compiler output around the error (not only the last line).
4. If you’re on macOS: open System Settings → Privacy & Security and allow `zkir` / the Compact binaries if they were blocked.
5. Then try a clean reinstall of a pinned compiler, e.g. `compact clean` then `compact update 0.31.1`, and recompile.

Once we know whether `--skip-zk` works and what OS/versions you’re on, we can narrow this down quickly. or better still open an issue on the [service desk](https://midnightntwrk.github.io/servicedesk/)
