Skip to content

Fix npx install for Claude Code v2.1.112#558

Open
frosty-geek wants to merge 2 commits into
BugRoger:mainfrom
frosty-geek:fix/npx-install-claude-code-v2
Open

Fix npx install for Claude Code v2.1.112#558
frosty-geek wants to merge 2 commits into
BugRoger:mainfrom
frosty-geek:fix/npx-install-claude-code-v2

Conversation

@frosty-geek
Copy link
Copy Markdown

Summary

npx beastmode install (via npx github:BugRoger/beastmode#v0.127.2) doesn't work on a clean Claude Code v2.1.112 installation. Four bugs in the npx installer prevent the plugin from loading, all introduced in v0.101.0.

Bugs fixed

1. .claude-plugin/ missing from files in package.json

package.json:9-13 — npm strips .claude-plugin/ from the tarball even when fetching from GitHub (npx respects the files field regardless of source). plugin-copier.mjs fails with ENOENT. Silent exit code 1.

2. Silent failure — error not shown to user

index.mjs:21process.exit(result.success ? 0 : 1) without printing result.error. User sees only Installing beastmode v0.127.2... then nothing.

3. Wrong field name in known_marketplaces.json

config-merger.mjs:40-41 — writes source.name but Claude Code expects source.package. Error: beastmode-marketplace.source.package: Invalid input: expected string, received undefined.

4. source: "npm" not implemented in Claude Code

config-merger.mjs:39-40 + plugin-copier.mjs:25-28 — Claude Code v2.1.112 responds NPM marketplace sources not yet implemented. Additionally, marketplace.json is written to the wrong location (Claude Code expects .claude-plugin/marketplace.json inside the marketplace dir), and the "source": "./plugin" relative path doesn't resolve.

Changes (4 files, +14 -7)

  • package.json — add .claude-plugin/ to files
  • src/npx-cli/index.mjs — print error on install failure
  • src/npx-cli/config-merger.mjs — use source: "directory" with path instead of source: "npm" with name
  • src/npx-cli/plugin-copier.mjs — write marketplace.json into .claude-plugin/ subdir, symlink plugin cache into marketplace dir so "source": "./plugin" resolves

Test plan

  • Reproduced all 4 bugs from clean state (no prior beastmode, fresh Claude Code)
  • Applied fixes and ran install from clean state
  • Verified /plugin shows no errors, marketplace loads, plugin enabled
  • Verified all beastmode skills register (/beastmode, /plan, /design, /implement, /validate, /release)

Environment

  • macOS Darwin 25.4.0
  • Claude Code 2.1.112
  • Node.js (via npx), Bun 1.3.12

Michael Schmidt and others added 2 commits April 12, 2026 21:42
## Fixes

- Resolve lockfile path to `.beastmode/.beastmode-watch.lock` instead of `cli/.beastmode-watch.lock`
- Update `.gitignore` entry to match new lockfile path

## Docs

- Update lockfile path references in orchestration and CLI context docs

## Artifacts

- Design: .beastmode/artifacts/design/2026-04-12-lockfile-path-fix-dcd0.md
- Plan: .beastmode/artifacts/plan/2026-04-12-lockfile-path-fix-dcd0--lockfile-path-fix.1.md
- Release: .beastmode/artifacts/release/2026-04-12-lockfile-path-fix-dcd0.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Four bugs prevented `npx beastmode install` from producing a working
plugin on a clean Claude Code installation:

1. `.claude-plugin/` missing from `files` in package.json — npm strips
   it from the tarball even when fetching from GitHub, causing
   plugin-copier to fail with ENOENT.

2. index.mjs exits with code 1 on install failure but never prints the
   error message — users see only the version banner.

3. config-merger.mjs writes `source.name` in known_marketplaces.json
   but Claude Code's Zod schema requires `source.package`.

4. config-merger.mjs uses `source: "npm"` which Claude Code v2.1.112
   hasn't implemented. Additionally, plugin-copier writes
   marketplace.json to the wrong location (Claude Code expects it in a
   `.claude-plugin/` subdirectory) and the `./plugin` relative source
   path doesn't resolve.

Fixes: include `.claude-plugin/` in package files, print install errors,
use `source: "directory"` instead of `source: "npm"`, write
marketplace.json into `.claude-plugin/` subdir, and symlink the plugin
cache so the relative source path resolves.

All bugs introduced in v0.101.0 (2d84d3c). Tested from clean state on
Claude Code v2.1.112 / macOS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@frosty-geek frosty-geek force-pushed the fix/npx-install-claude-code-v2 branch from 94de6f0 to 3531c61 Compare April 17, 2026 18:40
@frosty-geek
Copy link
Copy Markdown
Author

Superseded by #569 which includes these npx fixes plus full Windows/Linux terminal support (TerminalSessionFactory for wt/gnome-terminal), cross-platform process termination, and Windows-specific plugin marketplace fixes (directory junction, correct .claude-plugin/ layout).

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.

1 participant