Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" #253

Open
maggiben opened this issue Nov 21, 2024 · 1 comment
Open

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" #253

maggiben opened this issue Nov 21, 2024 · 1 comment

Comments

@maggiben
Copy link

maggiben commented Nov 21, 2024

Im trying to import or require the library but fails:

Welcome to Node.js v22.11.0.
Type ".help" for more information.
> const { create } = require("kubo-rpc-client");
Uncaught:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/bmaggi/projects/borrame/pepe/node_modules/kubo-rpc-client/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:296:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:586:13)
    at resolveExports (node:internal/modules/cjs/loader:640:36)
    at Function._findPath (node:internal/modules/cjs/loader:748:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1235:27)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
> 
(To exit, press Ctrl+C again or Ctrl+D or type .exit)

Steps to reproduce:

  • Initialize a new project: npm init
  • Install the library: npm install kubo-rpc-client
  • require the library: const { create } = require("kubo-rpc-client")
@sweatpotato13
Copy link

I using nest.js, and I got same error

anyone can solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants