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

No "exports" main defined in package.json #12

Open
jtlapp opened this issue Mar 28, 2023 · 0 comments
Open

No "exports" main defined in package.json #12

jtlapp opened this issue Mar 28, 2023 · 0 comments

Comments

@jtlapp
Copy link

jtlapp commented Mar 28, 2023

I get this error attempting to use this package with Node.js v18.14.0.

node:internal/modules/cjs/loader:544
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/joe/repos/fieldzoo/libs/database/node_modules/objectid64/package.json
    at new NodeError (node:internal/errors:399:5)
    at exportsNotFound (node:internal/modules/esm/resolve:361:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:641:13)
    at resolveExports (node:internal/modules/cjs/loader:538:36)
    at Module._findPath (node:internal/modules/cjs/loader:607:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1033:27)
    at Module._load (node:internal/modules/cjs/loader:893:27)
    at Module.require (node:internal/modules/cjs/loader:1113:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/joe/repos/fieldzoo/libs/database/dist/lib/id-encoder.js:27:33) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

This is the entire program:

import { Encoder } from "objectid64";
import { randomUUID } from "crypto";

export const idEncoder = new Encoder();

console.log(idEncoder.fromUUID(randomUUID()));
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

1 participant