fix: repair broken npm install caused by stale package-lock.json - #45
Open
batuhankocyigit wants to merge 1 commit into
Open
fix: repair broken npm install caused by stale package-lock.json#45batuhankocyigit wants to merge 1 commit into
batuhankocyigit wants to merge 1 commit into
Conversation
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.
fix: repair broken
npm installcaused by stale package-lock.jsonThe bug
A fresh clone of this repo cannot be installed.
package.jsonrequires:but the committed
package-lock.jsonhas that package locked to9.6.0,which does not satisfy
^10.0.1. Bothnpm installandnpm cifailimmediately on a clean checkout with:
This isn't cosmetic —
.github/workflows/ci.ymlrunsnpm installonevery PR and push to
master, so CI is currently broken for everyone, andany new contributor cloning the repo hits this on their first
npm install.Root cause
Two things compound here:
package.jsonwas bumped from the9.xline to^10.0.1at some pointwithout regenerating
package-lock.json, leaving the lockfile pinned tothe old
9.6.0.@circle-fin/developer-controlled-wallets@10.xdeclares apeerOptionaldependency on@solana/codecs-strings@^2.0.0, while thisproject's Solana-capable wallet tooling elsewhere in the dependency tree
pulls in
@solana/codecs-strings@5.5.1. npm's strict peer resolution(used by
npm ci, and bynpm installonce a conflicting lockfileexists) refuses to reconcile that on its own.
The fix
@circle-fin/developer-controlled-walletsresolves to
10.8.0(latest release satisfying^10.0.1at the time ofthis PR), matching what
package.jsonalready declares..npmrcwithlegacy-peer-deps=trueso npm resolves the@solana/codecs-stringspeerOptional mismatch the same way on everymachine and in CI, instead of only working by accident depending on
whether a lockfile happens to already be present.
package.json's version spec moved from^10.0.1to^10.8.0— this isnpm's normal behavior when you
npm install <pkg>@<range>and it recordsthe resolved version's range; it's a one-line, intentional part of this
diff, not scope creep.
(
lib/circle/sdk.ts,lib/circle/gateway-sdk.ts,app/api/gateway/transfer/route.ts) against the10.8.0typedefinitions — the APIs used are unchanged between
9.6.0and10.8.0.Testing
npm ci— now exits0on a clean checkout (previously failedimmediately).
npx tsc --noEmit— no new errors introduced by the SDK bump. (There isone pre-existing, unrelated failure in
app/api/deposit/route.test.ts—it uses
describe/it/expectbut no test runner is configured indevDependenciesorpackage.jsonscripts. That's a separate issue fromthis dependency fix and I've left it out of this PR to keep the diff
focused; happy to open a follow-up if that's useful.)
npm run build— production build completes successfully, all routescompile (
/api/deposit,/api/gateway/*,/api/transactions,/api/wallet,/dashboard, etc.).eslint,eslint-config-next, etc.)are untouched — this was a targeted update of the one out-of-sync
package, not a full lockfile regeneration, so the diff only touches what's
necessary to fix the install.
Notes for reviewers
rm package-lock.json && npm install,since that reflows every "^"-range dependency in the tree to whatever is
newest today and produces a huge, hard-to-review diff (it also happened
to surface an unrelated, pre-existing ESLint config crash on this repo,
which is out of scope here). This diff is scoped to just the one
dependency that's actually out of sync.