-
Notifications
You must be signed in to change notification settings - Fork 876
Description
Inspector Version
- 0.17.0
Describe the bug
When attempting to install and run @modelcontextprotocol/inspector, the process fails with an ERR_MODULE_NOT_FOUND error. The error indicates that the package's CLI cannot find its required package.json file.
To Reproduce
Steps to reproduce the behavior:
- Run the npx command to install @modelcontextprotocol/[email protected]
- Confirm installation prompt with 'y'
- Observe the error when the package attempts to execute
Expected behavior
The package should install and run successfully without any module resolution errors.
Environment (please complete the following information):
- OS: macOS
- Node.js: v22.20.0
Additional context
Full error stack trace shows that the issue occurs during ESM module resolution. The error specifically relates to not being able to find the package.json file at the path:
/Users/********/.npm/_npx/****************/node_modules/@modelcontextprotocol/inspector/cli/package.json
Full command:
npx @modelcontextprotocol/inspector \
--cli \
https://my.streamable.http.server/mcp \
--transport http \
--method tools/list \
--header "Authorization: MyBerarToken"
Full command output:
Need to install the following packages:
@modelcontextprotocol/[email protected]
Ok to proceed? (y) y
npm warn deprecated [email protected]: Use your platform's native DOMException instead
node:internal/modules/esm/resolve:274
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/********/.npm/_npx/*************/node_modules/@modelcontextprotocol/inspector/cli/package.json' imported from /Users/********/.npm/_npx/*************/node_modules/@modelcontextprotocol/inspector/cli/build/index.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:731:20)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38)
at ModuleJob._link (node:internal/modules/esm/module_job:183:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/********/.npm/_npx/*************/node_modules/@modelcontextprotocol/inspector/cli/package.json'
}
Node.js v22.20.0
Failed with exit code: 1