[RESOLVED] Error: spawn EACCES

So I’m trying to set up the Stockfish AI for my Discord bot with node-uci.
I have
const engine = new Engine(__dirname + '/assets/stockfish_8_x64_modern');
and stuff and I don’t get an error there, but when I follow it up with
engine.init()
I get an
UnhandledPromiseRejectionWarning: Error: spawn EACCES
and I don’t really know what that means or how to fix it?
I don’t know I’m pretty new to the forums here so I hope this is coherent.

I uploaded the file using the method here

code is here

Hey @MattTheWaffleCat, can you post the entire error message here, wrapped in three backticks :slightly_smiling_face:?

1 Like

yep!

    at ChildProcess.spawn (internal/child_process.js:313:11)
    at Object.exports.spawn (child_process.js:508:9)
    at Engine.init (/rbd/pnpm-volume/78ddeb53-2b88-4c77-a8e0-fc3a3ef3f155/node_modules/.registry.npmjs.org/node-uci/1.3.4/node_modules/node-uci/lib/index.js:1:141453)
at Object.<anonymous> (/app/server.js:11:8)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
(node:137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:137) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

So basically you’re missing permission to spawn it, do the stockfish binary have executable permissions? You could try setting them using chmod +x /path/to/executable

1 Like

oh that was actually really simple. I had to Google executable permissions 'cause I didn’t know what that meant but yeah that fixed it. Thanks!

Glad it fixed your issue :slight_smile: Have a nice evening!