Realm-cli, "Unknown system error -86"


I just started my first project working with realm, but I am not getting very far at all. I installed the realm CLI (npm install -g mongodb-realm-cli), but I am unable to run it. I get this error anytime I try running the realm-cli, no matter the input:

~ realm-cli -v
    throw errnoException(err, 'spawn');

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at spawn (node:child_process:700:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/mongodb-realm-cli/wrapper.js:22:22)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'

Node.js v17.9.0

I saw that there was one other ticket open about the same case:

Just like that user, I am also using an M1 mac, but his solution was to freshly setup his macbook again. My macbook however was just freshly setup, and yet I experience this problem anyway.

Is this an M1 specific issue? Any idea how I can fix this?


any luck with this? same issue for us here. pretty disappointing given M1 Macs have been around for a while now.

Sorry, no further luck with this yet. I spent 1-2 days trying different approaches, but I keep having this issue. This really is a bummer, there don’t seem to be many alternatives out there that are as service-complete as realm. If only it worked. :frowning:

Have you installed Rosetta on your system? You can try running softwareupdate --install-rosetta then trying again. I encountered the same problem when trying to run MongoMemoryServer and this fixed my problem.

1 Like

100% the answer, big thanks Tae Kwon Kim!!

A little more context as to what the issue is to help anyone facing the same issue.

If you’re using a M1 or M2 mac you’ll most likely run into this issue.

Rosetta is required because many apps have not yet been updated to support Apple’s new M1 chip, which uses a different architecture than the Intel processors used in previous Macs. By installing Rosetta, these apps can still run on M1 Macs.

Once the installation is complete, you can then run apps that were built for Intel-based Macs on your M1 Mac.