Skip to content

Can't import files in lib/ #350

Closed
@fisker

Description

@fisker

Since Node.js 17, require("diff/lib/patch/create.js") throws an error.

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

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/patch/create.js' is not defined by "exports" in <CWD>\node_modules\diff\package.json

There is also a warning when doing this on Node.js 16

(node:16332) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at <CWD>\node_modules\diff\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions