Skip to content

Error: Cannot find module 'pg' #11744

@SantiagoRR2004

Description

@SantiagoRR2004

I am creating this issue because I believe that pg should be a dependencies and not an optionalDependencies in package.json. In some computers executing node pokemon-showdown returns an error because pg isn't being installed.

The Node version is v24.13.0. Can I make a pull request changing that file?

npm warn Unknown project config "NODE_OPTIONS". This will stop working in the next major version of npm.
npm warn deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> pokemon-showdown@0.11.10 postinstall
> npm run build postinstall

npm warn Unknown project config "NODE_OPTIONS". This will stop working in the next major version of npm.

> pokemon-showdown@0.11.10 build
> node build postinstall


added 274 packages, and audited 275 packages in 1m

45 packages are looking for funding
run `npm fund` for details

20 vulnerabilities (4 low, 4 moderate, 10 high, 2 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues possible (including breaking changes), run:
npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Error: Cannot find module 'pg'
Require stack:
- /home/user/Pokemon/pokemon-showdown/dist/lib/database.js
- /home/user/Pokemon/pokemon-showdown/dist/server/roomlogs.js
- /home/user/Pokemon/pokemon-showdown/dist/server/rooms.js
- /home/user/Pokemon/pokemon-showdown/dist/server/index.js
- /home/user/Pokemon/pokemon-showdown/pokemon-showdown
    at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader:1227:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1504:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.<anonymous> (/home/user/Pokemon/pokemon-showdown/lib/database.ts:10:21)
    at Module._compile (node:internal/modules/cjs/loader:1761:14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions