DX-2599: fix CLI global install (pnpm peer-dep zod mismatch)#135
Merged
DX-2599: fix CLI global install (pnpm peer-dep zod mismatch)#135
Conversation
Moved @upstash/box from peerDependencies to dependencies and added zod as a direct dependency. With the old setup, pnpm's shared global store could hoist an incompatible zod (e.g. 3.24.2) from other global packages, causing zod-to-json-schema's `zod/v3` import to fail on startup with ERR_PACKAGE_PATH_NOT_EXPORTED.
alitariksahin
approved these changes
Apr 20, 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.
Summary
pnpm add -g @upstash/box-clicrashed on startup withERR_PACKAGE_PATH_NOT_EXPORTED: './v3' is not defined by "exports" in .../zod/package.json.@upstash/boxas apeerDependency, and the SDK'szodpeer range (^3.25.0 || ^4.0.0) got satisfied by an olderzod@3.24.2already present in pnpm's shared global store from other global packages.zod-to-json-schema@3.25.2importszod/v3— a subpath only added in zod3.25+— so loading the CLI blew up.@upstash/boxfrompeerDependenciestodependenciesand addzod: ^3.25.28as a direct dep of the CLI. A binary shouldn't leave its runtime libs to peer resolution.Verified
Installed the packed tarball three ways and confirmed
box --versionworks (previously only pnpm global failed, but all three are now verified clean):pnpm add -g <tarball>npm install -g <tarball>bun add -g <tarball>After the fix pnpm resolves
zod-to-json-schema@3.25.2_zod@3.25.76in the global store (was_zod@3.24.2).