Skip to content

ERR_MODULE_NOT_FOUND vscode-jsonrpc\node #265

Closed

Description

@LasseAtSparkron

fresh install using npm install -g @bradygaster/squad-cli
or using the one off : npx @bradygaster/squad-cli gives error when using squads commands with the error message below.

There is a typo in the copilot-sdk\dist\session.js

missing the "js" file type, hence it keep getting errors.

Manually editing the file makes it work again:

import { ConnectionError, ResponseError } from "vscode-jsonrpc/node"; -> import { ConnectionError, ResponseError } from "vscode-jsonrpc/node.js";

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\x\AppData\Roaming\npm\node_modules@bradygaster\squad-cli\node_modules\vscode-jsonrpc\node' imported from C:\Users\x\AppData\Roaming\npm\node_modules@bradygaster\squad-cli\node_modules@github\copilot-sdk\dist\session.js
Did you mean to import "vscode-jsonrpc/node.js"?
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:865:10)
at defaultResolve (node:internal/modules/esm/resolve:991:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:719:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:736:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:765:52)
at #resolve (node:internal/modules/esm/loader:701:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:621:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:160:33)
at ModuleJob.link (node:internal/modules/esm/module_job:245:17) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///C:/Users/x/AppData/Roaming/npm/node_modules/@bradygaster/squad-cli/node_modules/vscode-jsonrpc/node'
}

Activity

  1. LasseAtSparkron commented on Mar 7, 2026

    @LasseAtSparkron
    Author

    looks like it's the copilot-sdk dependency that was upgraded today, any chance to lock it to an older version until the dependency are fixet ?

    Related issue : github/copilot-sdk#707

  2. MatthewSteeples commented on Mar 7, 2026

    @MatthewSteeples

    0.8.23 fixes this for me

    EDIT: It fixed me running npx squad init, but not just npx squad

  3. LasseAtSparkron commented on Mar 7, 2026

    @LasseAtSparkron
    Author

    I tried aswell with the 0.8.23
    Works with the global version installed.

    uninstalling
    npm uninstall -g @bradygaster/squad-cli

    and running the one off makes it crash.

    npx @bradygaster/squad-cli

    Need to install the following packages:
    @bradygaster/squad-cli@0.8.23
    Ok to proceed? (y) y
    Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\x\AppData\Local\npm-cache_npx\e1d26af36c0531f6\node_modules\vscode-jsonrpc\node' imported from C:\Users\x\AppData\Local\npm-cache_npx\e1d26af36c0531f6\node_modules@github\copilot-sdk\dist\session.js
    Did you mean to import "vscode-jsonrpc/node.js"?
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:865:10)
    at defaultResolve (node:internal/modules/esm/resolve:991:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:719:20)
    at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:736:38)
    at ModuleLoader.resolveSync (node:internal/modules/esm/loader:765:52)
    at #resolve (node:internal/modules/esm/loader:701:17)
    at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:621:35)
    at ModuleJob.syncLink (node:internal/modules/esm/module_job:160:33)
    at ModuleJob.link (node:internal/modules/esm/module_job:245:17) {
    code: 'ERR_MODULE_NOT_FOUND',
    url: 'file:///C:/Users/x/AppData/Local/npm-cache/_npx/e1d26af36c0531f6/node_modules/vscode-jsonrpc/node'

  4. bradygaster commented on Mar 8, 2026

    @bradygaster
    Collaborator

    @MatthewSteeples and @LasseAtSparkron thanks for reporting this and iterating. I fired up a codespace and tried this with 0.8.22 and still had the error, so i re-pushed 0.8.23 and tried it and the error went away. Note - i did not try over-the-top of the failing 0.8.22 release, i just fired up a new codespace and tried again.

    Can you confirm 0.8.23 "just works" with a new repo/folder whereas upgrading from 0.8.22 to 0.8.23 does not fix it?

  5. github-actions commented on Mar 8, 2026

    @github-actions
    Contributor

    📋 Assigned to Fortier (Node.js Runtime)

    Issue: #265 — ERR_MODULE_NOT_FOUND vscode-jsonrpc\node

    Fortier will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    Fortier, work on issue #265

  6. github-actions commented on Mar 8, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Keaton (Lead)

    Issue: #265 — ERR_MODULE_NOT_FOUND vscode-jsonrpc\node
    Assigned to: Keaton (Lead)
    Reason: No specific domain match — assigned to Lead for further analysis

    @copilot evaluation: No strong capability match — routed to squad member.

    Team roster:

    • Keaton (Lead) → label: squad:keaton
    • Verbal (Prompt Engineer) → label: squad:verbal
    • Fenster (Core Dev) → label: squad:fenster
    • Hockney (Tester) → label: squad:hockney
    • McManus (DevRel) → label: squad:mcmanus
    • Kujan (SDK Expert) → label: squad:kujan
    • Edie (TypeScript Engineer) → label: squad:edie
    • Trejo (Release Manager) → label: squad:trejo
    • Drucker (CI/CD Engineer) → label: squad:drucker
    • Fortier (Node.js Runtime) → label: squad:fortier
    • Rabin (Distribution) → label: squad:rabin
    • Baer (Security) → label: squad:baer
    • Redfoot (Graphic Designer) → label: squad:redfoot
    • Strausz (VS Code Extension) → label: squad:strausz
    • Saul (Aspire & Observability) → label: squad:saul
    • Kovash (REPL & Interactive Shell) → label: squad:kovash
    • Marquez (CLI UX Designer) → label: squad:marquez
    • Cheritto (TUI Engineer) → label: squad:cheritto
    • Breedan (E2E Test Engineer) → label: squad:breedan
    • Nate (Accessibility Reviewer) → label: squad:nate
    • Waingro (Product Dogfooder) → label: squad:waingro
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  7. bradygaster commented on Mar 8, 2026

    @bradygaster
    Collaborator

    Root Cause Analysis

    The bug is upstream in @github/copilot-sdk@0.1.32 — session.js imports 'vscode-jsonrpc/node' instead of 'vscode-jsonrpc/node.js'. Node 24+ enforces strict ESM resolution and rejects the bare import.

    v0.8.23 partially fixed this:

    • ✅ npm install -g @bradygaster/squad-cli works (postinstall script patches the file)
    • ✅ npx squad init works (lazy-load means init never imports copilot-sdk)
    • ❌ npx squad (no subcommand) still crashes — npx caches packages and skips postinstall, so the patch never runs

    Workaround (for users on v0.8.23)

    Option 1 — Use global install instead of npx:

    npm install -g @bradygaster/squad-cli
    squad init
    

    Option 2 — If you must use npx, clear the cache first:

    npx --yes --package @bradygaster/squad-cli@0.8.23 squad init
    

    If that still fails, clear the npx cache:

    # Find your npx cache
    npm config get cache
    # Delete the _npx folder inside it, then retry
    

    Option 3 — Manual patch:
    Find the cached copilot-sdk file and change vscode-jsonrpc/node to vscode-jsonrpc/node.js in node_modules/@github/copilot-sdk/dist/session.js.

    Fix coming in v0.8.24

    We've added a runtime Module._resolveFilename intercept that rewrites the broken import at startup — no postinstall needed. This fixes all installation methods (global, npx, local). Tracking in commit 09e745f.

    Upstream issue: github/copilot-sdk#707

  8. 2 remaining items

  9. added
    status:doneWork completed and shipped
    and removed on Mar 8, 2026
  10. added a commit that references this issue on Mar 15, 2026
  11. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:yesReady to implementpriority:p1This sprintrelease:nextTargeted for next releasesquadSquad triage inbox — Lead will assign to a memberstatus:doneWork completed and shippedtype:bugSomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions