wizard --version prints unknown when run through npx
Maintainers usually reply within 2 days
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PostHog/wizard
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
PostHog/wizard#1460 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description textMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PostHog/wizard#986 · 4 comments ·
Maintainers usually reply within 2 days
-
Intro shows "(detected)" after a manual pick from the detection-failed pickerPossibly taken @ShobhanKarthish claimed this 87 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nicobailon/pi-subagents#3420 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
openwatersio/slackwater.xyz#309 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
navikt/nav-enonicxp-frontend#3122 ·
Maintainers usually reply within 1 day
-
complexity → simple frontend performance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencollective/opencollective#9200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day