Skip to content

DX-2599: fix CLI global install (pnpm peer-dep zod mismatch)#135

Merged
ytkimirti merged 1 commit intomainfrom
DX-2599-fix-cli-global-install
Apr 20, 2026
Merged

DX-2599: fix CLI global install (pnpm peer-dep zod mismatch)#135
ytkimirti merged 1 commit intomainfrom
DX-2599-fix-cli-global-install

Conversation

@ytkimirti
Copy link
Copy Markdown
Contributor

Summary

  • Global pnpm add -g @upstash/box-cli crashed on startup with ERR_PACKAGE_PATH_NOT_EXPORTED: './v3' is not defined by "exports" in .../zod/package.json.
  • Root cause: the CLI had @upstash/box as a peerDependency, and the SDK's zod peer range (^3.25.0 || ^4.0.0) got satisfied by an older zod@3.24.2 already present in pnpm's shared global store from other global packages. zod-to-json-schema@3.25.2 imports zod/v3 — a subpath only added in zod 3.25+ — so loading the CLI blew up.
  • Fix: move @upstash/box from peerDependencies to dependencies and add zod: ^3.25.28 as 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 --version works (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.76 in the global store (was _zod@3.24.2).

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.
@linear
Copy link
Copy Markdown

linear Bot commented Apr 20, 2026

@ytkimirti ytkimirti merged commit 04891f8 into main Apr 20, 2026
3 checks passed
@ytkimirti ytkimirti deleted the DX-2599-fix-cli-global-install branch April 20, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants