chore(web-ui): add .npmrc with legacy-peer-deps=true#307
Merged
Conversation
Pin npm to use --legacy-peer-deps for the web/ui workspace so that both Renovate and any local install pick it up automatically. Without this, `npm install` in web/ui fails with ERESOLVE because react-scripts@5.0.1 only allows TypeScript ^3 || ^4 while the root project depends on typescript@^5.0.0. The Makefile already passes --legacy-peer-deps for human invocations; this file extends the same behavior to Renovate's lock-file refresh, unblocking dependency PRs that need to regenerate package-lock.json. Made-with: Cursor
The flag is now sourced from web/ui/.npmrc, so passing it explicitly on the npm command line is redundant. Dropping it keeps a single source of truth for the install behavior. Made-with: Cursor
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.
Summary
web/ui/.npmrcwithlegacy-peer-deps=trueso anynpm installinweb/ui/uses legacy peer-dep resolution automatically.--legacy-peer-depsflag from theui-installandui-bump-versiontargets inMakefile.Why
web/ui/has a long-standing peer-dependency conflict betweentypescript@^5.0.0(declared at the workspace root) andreact-scripts@5.0.1(used by thereact-appworkspace, which still pins TypeScript to^3 || ^4). On modern npm a clean install fails withERESOLVE:We already worked around this in
Makefileby passing--legacy-peer-deps, but Renovate drivesnpm installdirectly (without that flag) when refreshingpackage-lock.jsonafter a dependency bump, which causes Renovate to skip the lock-file update and post a comment instead — see e.g. #304.Committing the flag to
.npmrcfixes this for all callers (Renovate, CI, local devs) and removes the need to remember the flag manually. After this lands, Renovate should be able to regenerateweb/ui/package-lock.jsonautomatically on the next run.Test plan
make ui-installstill works locally (no flag needed).