Repository navigation
fix(build): install web deps reliably in build-all.sh - #158
Merged
Merged
Conversation
Gate npm ci on node_modules/.package-lock.json freshness (and vite being present) instead of the node_modules directory mtime, pass --include=dev so NODE_ENV=production or an omit=dev npm config cannot drop vite, and fail with a clear message when node or npm is missing.
Owner
Author
|
TL ACCEPT at Script-only change matches the locked AC: missing Node/npm fails with a clear message + Please add |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #159
Problem
./scripts/build-all.sh --installcan fail withsh: 1: vite: not found. The old gate skippednpm ciwhenever aweb/node_modulesdirectory existed and its mtime was newer thanpackage-lock.json, so a partial, stale, or dev-lessnode_moduleswas trusted. On a fresh clone,NODE_ENV=production(or anomit=devnpm config) makesnpm cidrop devDependencies, andviteis a devDependency. Reproduced:NODE_ENV=production npm ci && npm run buildprintsvite: not found.Change (
scripts/build-all.shonly)nodeornpmis missing. The message names the missing tool, the required Node version (^20.19 or >=22.12, from vite 8 engines), how to install it, and the--skip-webescape hatch.npm ciwhenweb/node_modules/.package-lock.jsonis missing, older thanweb/package-lock.json, ornode_modules/.bin/viteis absent. npm 7+ rewrites.package-lock.jsonafter every install, so a lock change (for example aftergit pull) triggers a reinstall. Otherwise skip.npm ci --include=dev, soNODE_ENV=productionoromit=devcannot drop vite.Verification (cargo stubbed, fresh clone of this branch)
NODE_ENV=production ./scripts/build-all.sh --install: runsnpm ci, then vite build, thencargo install.npm ci, web step about 0.7s (no slowdown).touch web/package-lock.json: reinstalls.node_moduleswithout.bin/vite: reinstalls.ERROR: 'node' not found ..., exit 1. PATH with node but no npm:ERROR: 'npm' not found ....bash -nclean. No Rust changes.