Skip to content

Error: Could not load the "sharp" module using the win32-x64 runtime #287

@damianh

Description

@damianh

Describe the bug

Just upgraded copilot CLI and now copilot won't start. This is the error message:

> copilot --version
C:\Users\damian\AppData\Roaming\npm\node_modules\@github\copilot\node_modules\sharp\lib\sharp.js:121
  throw new Error(help.join('\n'));
        ^

Error: Could not load the "sharp" module using the win32-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=win32 --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (C:\Users\damian\AppData\Roaming\npm\node_modules\@github\copilot\node_modules\sharp\lib\sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Module.require (node:internal/modules/cjs/loader:1463:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (C:\Users\damian\AppData\Roaming\npm\node_modules\@github\copilot\node_modules\sharp\lib\constructor.js:10:1)

Node.js v22.20.0

None of the suggested solutions made any difference.

Affected version

0.0.329

Steps to reproduce the behavior

npm install -g @github/copilot:latest
copilot --version

Expected behavior

Should not throw an error.

Additional context

Windows 11, x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingWe're investigating this report

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions