Summary
When the installer removes a front-end tool, it edits package.json but leaves package-lock.json untouched. The two then disagree, and npm ci refuses to install: it treats the lock file as authoritative and aborts rather than reconciling it.
This affects a generated project on its first build, so it surfaces as a broken site rather than as a warning.
Details
The gap is partial deselection. When every front-end tool is deselected, the frontend_all group removes package.json and package-lock.json together, so that path is consistent. When only some are deselected - ESLint off with Jest kept, for example - package.json is rewritten through JsonManipulator::updateFile(), the lock file is left as it was, and the pair no longer matches.
The behaviour is not specific to ESLint. Every tool in the map edits package.json the same way, so any combination that removes one tool and keeps another reaches it. It also predates the move to npm: yarn.lock was committed before that change and yarn install --frozen-lockfile fails on the same mismatch, so only the error message changed.
Found during review of #3047: #3047 (comment)
Summary
When the installer removes a front-end tool, it edits
package.jsonbut leavespackage-lock.jsonuntouched. The two then disagree, andnpm cirefuses to install: it treats the lock file as authoritative and aborts rather than reconciling it.This affects a generated project on its first build, so it surfaces as a broken site rather than as a warning.
Details
The gap is partial deselection. When every front-end tool is deselected, the
frontend_allgroup removespackage.jsonandpackage-lock.jsontogether, so that path is consistent. When only some are deselected - ESLint off with Jest kept, for example -package.jsonis rewritten throughJsonManipulator::updateFile(), the lock file is left as it was, and the pair no longer matches.The behaviour is not specific to ESLint. Every tool in the map edits
package.jsonthe same way, so any combination that removes one tool and keeps another reaches it. It also predates the move to npm:yarn.lockwas committed before that change andyarn install --frozen-lockfilefails on the same mismatch, so only the error message changed.package.jsonand its lock file consistent whenever the installer removes tool dependencies, for every tool in the map rather than for one of them.Found during review of #3047: #3047 (comment)