Skip to content

Switch the mods installation back into the main node_modules#393

Open
tiennou wants to merge 1 commit into
Jomik:mainfrom
tiennou:fix/merged-node-modules
Open

Switch the mods installation back into the main node_modules#393
tiennou wants to merge 1 commit into
Jomik:mainfrom
tiennou:fix/merged-node-modules

Conversation

@tiennou

@tiennou tiennou commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

The issue is that, because of the split between /screeps/node_modules and /screeps/mods/node_modules, depending on a mod's dependencies, you could end up with a "split package" situation.

A good example of that is screepsmod-auth, which has a peer dep on @screeps/backend. This ends up pulling another copy of passport, which means that now the server talks to /screeps/node_modules/passport, while screepsmod-auth talks to /screeps/mods/node_modules/passport. With both having different authentication strategy stacks, you get random auth errors when the 'token' strategy isn't found.

For consistency, just install everything into the server's package tree, but keep around a mods/managed-deps.json "lockfile" in a separate volume that lets us keep track of the last installed versions to prefer in case the container gets recreated.

The issue is that, because of the split between /screeps/node_modules
and /screeps/mods/node_modules, depending on a mod's dependencies, you
could end up with a "split package" situation.

A good example of that is screepsmod-auth, which has a peer dep on
@screeps/backend. This ends up pulling another copy of passport, which
means that now the server talks to `/screeps/node_modules/passport`,
while screepsmod-auth talks to `/screeps/mods/node_modules/passport`.
With both having different authentication strategy stacks, you get
random auth errors when the 'token' strategy isn't found.

For consistency, just install everything into the server's package tree,
but keep around a `mods/managed-deps.json` "lockfile" in a separate
volume that lets us keep track of the last installed versions to prefer
in case the container gets recreated.
@tiennou tiennou requested a review from Jomik as a code owner June 16, 2026 23:43
@github-actions github-actions Bot added the bug Something isn't working label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant