smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Error when running the server (IPC channel disconnected) #7868

Closed LoryColo closed 3 years ago

LoryColo commented 3 years ago

I tried installing this on my raspberry pi B to try and run a simple server and do some tests on it, i was able to clone the repository and i installed node 15, i did ./build and everything was fine. When i try to run the server with ./pokemon-showdown start [--skip-build] [PORT] it starts but i instantly get this error Any idea what could be causing this?

~/pokemon-showdown $ ./pokemon-showdown start [--skip-build] [PORT]
RESTORE CHATROOM: lobby
RESTORE CHATROOM: staff
/home/pi/pokemon-showdown/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: libnode.so.64: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1167:18)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at bindings (/home/pi/pokemon-showdown/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/home/pi/pokemon-showdown/node_modules/better-sqlite3/lib/database.js:9:24)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32) {
  code: 'ERR_DLOPEN_FAILED'
}

CRASH: Error [ERR_IPC_DISCONNECTED]: IPC channel is already disconnected
    at new NodeError (node:internal/errors:278:15)
    at ChildProcess.target.disconnect (node:internal/child_process:872:26)
    at QueryProcessWrapper.destroy (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:178:16)
    at QueryProcessWrapper.release (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:164:9)
    at QueryProcessManager.releaseCrashed (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:421:16)
    at ChildProcess.<anonymous> (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:468:48)
    at ChildProcess.emit (node:events:376:20)
    at ChildProcess.EventEmitter.emit (node:domain:470:12)
    at finish (node:internal/child_process:902:14)
    at processTicksAndRejections (node:internal/process/task_queues:75:11)
mia-pi-git commented 3 years ago

Try deleting /node_modules/ and doing npm install? looks like the sqlite module is crashing. If not, you can always just remove the module.

AnnikaCodes commented 3 years ago

Have you tried running sudo apt-get update && sudo apt-get install libnode-dev? It looks like you're missing a library that SQLite expects.

LoryColo commented 3 years ago

Have you tried running sudo apt-get update && sudo apt-get install libnode-dev? It looks like you're missing a library that SQLite expects.

I ran that command and it is now spitting out this error, seems to be better than before tough

malloc(): invalid size (unsorted)

CRASH: Error [ERR_IPC_DISCONNECTED]: IPC channel is already disconnected
    at new NodeError (node:internal/errors:278:15)
    at ChildProcess.target.disconnect (node:internal/child_process:872:26)
    at QueryProcessWrapper.destroy (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:178:16)
    at QueryProcessWrapper.release (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:164:9)
    at QueryProcessManager.releaseCrashed (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:421:16)
    at ChildProcess.<anonymous> (/home/pi/pokemon-showdown/.lib-dist/process-manager.js:468:48)
    at ChildProcess.emit (node:events:376:20)
    at ChildProcess.EventEmitter.emit (node:domain:470:12)
    at finish (node:internal/child_process:902:14)
    at processTicksAndRejections (node:internal/process/task_queues:75:11) 
LoryColo commented 3 years ago

Try deleting /node_modules/ and doing npm install? looks like the sqlite module is crashing. If not, you can always just remove the module.

I tried deleting that folder but now npm install results in bash: /usr/bin/node: No such file or directory, i think it might be linked to the fact that i ran sudo apt-get update && sudo apt-get install libnode-dev as someone was suggesting

EDIT: i reinstalled node and npm and was able to run npm install after removing the directory, fingers crossed

LoryColo commented 3 years ago

Was able to get it up and running, ty everyone for the help