You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Error [ERR_PACKAGE_PATH_NOT_EXPORTED] when importing @modelcontextprotocol/sdk
Body:
Description:
I am encountering the following error when trying to start my NestJS application using the @modelcontextprotocol/sdk package:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in E:\nestMcp\in-browser-mcp-backend\node_modules\@modelcontextprotocol\sdk\package.json
at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
at new NodeError (node:internal/errors:405:5)
at exportsNotFound (node:internal/modules/esm/resolve:366:10)
at packageExportsResolve (node:internal/modules/esm/resolve:713:9)
at resolveExports (node:internal/modules/cjs/loader:590:36)
at Module._findPath (node:internal/modules/cjs/loader:664:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1126:27)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (E:\nestMcp\in-browser-mcp-backend\src\mcp\mcp.provider.ts:3:1)
...
Environment:
Node.js version: v18.20.4
@modelcontextprotocol/sdk version: ^1.10.2
Operating System: Windows
Steps to reproduce:
Install dependencies using pnpm install.
Run the application with pnpm run start.
The application fails to start with the above error.
Expected behavior:
The application should start without any errors.
Additional context:
It seems that the @modelcontextprotocol/sdk package does not properly define an exports field in its package.json, which causes Node.js to throw an ERR_PACKAGE_PATH_NOT_EXPORTED error when attempting to import from the package.
Could you please look into this and provide guidance or a fix?
Possible Solution:
Verify that the exports field is correctly set in the package.json of @modelcontextprotocol/sdk.
Alternatively, if you know of any workaround or patch, please let me know.
Thank you!
The text was updated successfully, but these errors were encountered:
it works fine. However, when I try to load the same project into the Claude Desktop app (Claude for Mac – version 0.9.3), it crashes, and the log shows the error above.
Title: Error [ERR_PACKAGE_PATH_NOT_EXPORTED] when importing
@modelcontextprotocol/sdk
Body:
Description:
I am encountering the following error when trying to start my NestJS application using the
@modelcontextprotocol/sdk
package:Environment:
Steps to reproduce:
pnpm install
.pnpm run start
.Expected behavior:
The application should start without any errors.
Additional context:
It seems that the
@modelcontextprotocol/sdk
package does not properly define anexports
field in itspackage.json
, which causes Node.js to throw anERR_PACKAGE_PATH_NOT_EXPORTED
error when attempting to import from the package.Could you please look into this and provide guidance or a fix?
Possible Solution:
exports
field is correctly set in thepackage.json
of@modelcontextprotocol/sdk
.Thank you!
The text was updated successfully, but these errors were encountered: