fix: use native stockfish binary via debian image
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
"nanoid": "^5.0.7",
|
||||
"pg": "^8.12.0",
|
||||
"socket.io": "^4.7.5",
|
||||
"stockfish": "^16.0.0",
|
||||
"xss": "^1.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { spawn, ChildProcess } from "child_process";
|
||||
import { createRequire } from "module";
|
||||
|
||||
export interface StockfishLevel {
|
||||
level: number;
|
||||
@@ -31,10 +30,7 @@ export class StockfishEngine {
|
||||
|
||||
private async init() {
|
||||
try {
|
||||
const require = createRequire(import.meta.url);
|
||||
const sfPath: string = require.resolve("stockfish");
|
||||
|
||||
this.process = spawn(process.execPath, [sfPath], {
|
||||
this.process = spawn("stockfish", [], {
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user