fix: install no longer fails on tree-sitter peer-dep ERESOLVE (#2300)

* fix: install no longer fails on tree-sitter peer-dep ERESOLVE

The marketplace npm install was failing on a peer-dep conflict between
@derekstride/tree-sitter-sql (peers tree-sitter@^0.21) and
@tree-sitter-grammars/tree-sitter-lua (peers tree-sitter@^0.22.4),
breaking install across all 12 supported IDEs (#2261-#2272).

The conflict is irrelevant: smart_outline/smart_search/smart_unfold use
the tree-sitter CLI + .wasm files shipped inside each grammar package,
never the JS native bindings, so the peer warning is harmless.

- package.json: move grammar packages to dependencies (their .wasm files
  are loaded at runtime by parser.ts, so they were never devDeps).
- src/npx-cli/commands/install.ts: pass --legacy-peer-deps to silence
  the resolver and replace deprecated --production with --omit=dev.

Verified across all 12 IDEs in the install harness: zero npm errors,
21 grammar packages installed, smart_outline parses TypeScript and
smart_search matches across TypeScript+Python.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: clarify --legacy-peer-deps rationale in marketplace install

Addresses Greptile review comment on PR #2300.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-05-04 20:21:23 -07:00
committed by GitHub
parent 39f1102600
commit 3ff6fcbe1e
2 changed files with 30 additions and 26 deletions
+5 -1
View File
@@ -539,7 +539,11 @@ function runNpmInstallInMarketplace(): void {
if (!existsSync(packageJsonPath)) return;
execSync('npm install --production', {
// --legacy-peer-deps suppresses a known false-positive ERESOLVE between
// tree-sitter@0.21 and @tree-sitter-grammars/* peer ranges. The native
// bindings path is unused (we load .wasm), so the conflict is benign.
// Revisit if real peer constraints are added to the marketplace deps.
execSync('npm install --omit=dev --legacy-peer-deps', {
cwd: marketplaceDir,
stdio: 'pipe',
encoding: 'utf8',