gamedig / node-gamedig

Query game servers and not only! Node.JS/Deno/Bun or Bash (via the CLI).
https://www.npmjs.com/package/gamedig
MIT License
606 stars 148 forks source link

bug: Just Cause 2 Gamedig 5 error #540

Closed dgibbs64 closed 7 months ago

dgibbs64 commented 7 months ago

Describe the bug Just Cause 2 Gamedig 5 error

Steps To Reproduce

/app/lgsm/node_modules/gamedig/bin/gamedig.js --type "jc2m" "127.0.0.1:7779"|jq
node:internal/modules/cjs/loader:1144
  const err = new Error(message);
              ^

Error: Cannot find module 'process-nextick-args'
Require stack:
- /app/lgsm/node_modules/string-to-stream/node_modules/readable-stream/lib/_stream_readable.js
- /app/lgsm/node_modules/string-to-stream/node_modules/readable-stream/readable.js
- /app/lgsm/node_modules/string-to-stream/index.js
- /app/lgsm/node_modules/gbxremote/lib/client.js
- /app/lgsm/node_modules/gbxremote/lib/gbxremote.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/app/lgsm/node_modules/string-to-stream/node_modules/readable-stream/lib/_stream_readable.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/lgsm/node_modules/string-to-stream/node_modules/readable-stream/lib/_stream_readable.js',
    '/app/lgsm/node_modules/string-to-stream/node_modules/readable-stream/readable.js',
    '/app/lgsm/node_modules/string-to-stream/index.js',
    '/app/lgsm/node_modules/gbxremote/lib/client.js',
    '/app/lgsm/node_modules/gbxremote/lib/gbxremote.js'
  ]
}

Node.js v20.11.0

I have tested on gamedig 4 and getting no errors

podrivo commented 7 months ago

Tested on servers from this list and it worked on all of them. Maybe delete node_modules and reinstall?

Example response:

node bin/gamedig --type jc2m 185.34.216.12:7777 --pretty

{
  "name": "JC2RP",
  "map": "",
  "password": false,
  "raw": {
    "playerTeamInfo": {},
    "description": "Participate in PvP skirmishes to capture territory, scavenge for loot, catch fish and explore a roleplay sandbox shaped by other players.",
    "hostname": "JC2RP",
    "maxplayers": "200",
    "numplayers": "0",
    "password": "False",
    "version": "935",
    "numPlayers2": 0
  },
  "maxplayers": 200,
  "numplayers": 0,
  "players": [],
  "bots": [],
  "queryPort": 7777,
  "connect": "185.34.216.12:7777",
  "ping": 302
}
dgibbs64 commented 7 months ago

It appears that in my docker container npm install is not always pulling in all the modules correctly. I will close this as its an npm related issue and not gamedig