nmrugg/stockfish.js

when compiling: Error: ENOENT: no such file or directory node_modules/stockfish/src/misc.cpp'

ps2-controller opened this issue · 1 comments

Steps I took: (with emscripten compiler installed and in the path, version 2.0.26)

npm install stockfish
node_modules/stockfish/build.js

node:internal/fs/utils:347
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/path/to/node_modules/stockfish/src/misc.cpp'
    at Object.openSync (node:fs:584:3)
    at Object.readFileSync (node:fs:452:35)
    at changeVersion (/path/to/node_modules/stockfish/build.js:141:19)
    at Object.<anonymous> (/path/to/node_modules/stockfish/build.js:499:5)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
    at node:internal/main/run_main_module:23:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/path/to/node_modules/stockfish/src/misc.cpp'
}

Node.js v19.3.0

macOS Monterey version 12.6

Closing the issue - I don't think compiling is necessary when using the npm package? I'm able to use the engine directly with node stockfish/src/stockfish-nnue-16.js