Skip to content

fix: start without waiting for npm's audit request - #113

Merged
dgibbs64 merged 2 commits into
GameServerManagers:mainfrom
heyvaldemar:fix/npm-install-no-audit
Nov 1, 2026
Merged

dgibbs64 merged 2 commits into
GameServerManagers:mainfrom
heyvaldemar:fix/npm-install-no-audit

Conversation

@heyvaldemar

Copy link
Copy Markdown
Contributor

Description

entrypoint-user.sh runs npm install in /app/lgsm on every start. Even when node_modules is already complete, npm sends its audit request to the registry, and when the registry accepts the connection but does not answer, the start waits on it. On a Killing Floor 2 server built on this image, a start took about twenty minutes the night the registry did not answer, and twenty-five seconds after the deployment turned audit off (it also bounded npm's other timeouts; the measurement below shows audit is the one that matters).

This adds --no-audit to that npm install. The entrypoint never reads the audit result, so nothing it does changes; installs that do need the registry (a first start with no node_modules) behave as before.

Every gameservermanagers/gameserver image inherits this entrypoint (FROM ghcr.io/gameservermanagers/linuxgsm), so the one flag covers all of them.

Testing

In gameservermanagers/gameserver:hz (node v24.22.1, npm 12.2.1): installed LinuxGSM's package.json once with the registry reachable, then pointed registry.npmjs.org at a local listener that accepts every connection and never answers, and timed npm install in /app/lgsm as the linuxgsm user, 90-second limit:

Arguments Result
(none, as today) still waiting at 90 s (timed out)
--no-audit done in 1 s
--no-audit --no-fund --no-update-notifier done in 1 s
the above plus --prefer-offline done in 1 s

--no-audit alone makes the difference, so it is the only change. shellcheck -S warning entrypoint-user.sh is clean.


This change was prepared with AI assistance and reviewed before submitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants