Add version mismatch warning between standalone binary and local node_modules install#534
Open
Add version mismatch warning between standalone binary and local node_modules install#534
Conversation
🦋 Changeset detectedLatest commit: d6df257 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…cal node_modules install Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/9c46e44c-4e1e-41a8-bb8b-475279f531dc Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
…kip warning for --version/--help Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/9c46e44c-4e1e-41a8-bb8b-475279f531dc Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix version check between node_modules and standalone binary
Add version mismatch warning between standalone binary and local node_modules install
Apr 2, 2026
philmillman
approved these changes
Apr 2, 2026
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.
When users have both a standalone binary (homebrew/curl) and a project-level npm install of varlock at different versions, the CLI silently uses whichever is on PATH, producing confusing errors from version incompatibilities.
Changes
packages/varlock/src/lib/check-local-version.ts— NewcheckLocalVersionMismatch()that walks up fromcwdlooking fornode_modules/varlock/package.jsonand compares its version against the running binary's versionpackages/varlock/src/cli/cli-executable.ts— Calls the check on SEA builds only, skipping--version/--helpfor clean outputpackages/varlock/src/lib/test/check-local-version.test.ts— 9 tests covering match, mismatch, parent directory traversal, malformed package.json, and missing version fieldBehavior
Only triggers when
__VARLOCK_SEA_BUILD__is true and a local install exists with a differing version:Silently no-ops when: no local install exists, versions match, or package.json is unreadable.