wizard --version prints unknown when run through npx

Open Beginner friendly
#1,621 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@bryanlundberg is already working on this.

Since Nov 28, 2026.

  • #1625 by @bryanlundberg — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
cli

Research direction

Read src/cli/wizard.ts where .version() is called and check how the version is defined or imported; the issue points to VERSION in the built bundle. Pass the package version to the CLI version handler, then verify that both --version and -v report 3.0.0 when invoked through npx and a global install.

Written by the indexing model from the issue text.

Description

Both --version and -v print unknown.

$ npx -y @posthog/wizard@latest --version
unknown

The installed package is 3.0.0. The TUI header shows PostHog Wizard v3.0.0 and the bundle has VERSION = "3.0.0" in dist/debug-*.js.

I think the cause is that src/cli/wizard.ts calls .version() without an argument. yargs 16 then looks for package.json in the folder above node_modules (fileURLToPath(import.meta.url).split('node_modules')[0]), and under npx that's ~/.npm/_npx/<hash>/package.json. That's npx's own temporary manifest and it has no version field, so yargs prints unknown.

Passing the version directly with .version(VERSION) should fix it for both npx and global installs. It's also the version people usually paste into bug reports.

I ran it with wizard 3.0.0 through npx, yargs 16.2.2, Node 25.2.1 and macOS arm64.

Dominant language
TypeScript
Stars
208
Forks
58
Avg merge
2d 7h
Merged PRs (30d)
76

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PostHog/wizard

All issues in PostHog/wizard

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.