Skip to content

Cannot find package node_modules/@apidevtools/json-schema-ref-parser/index.js #399

@mikeharder

Description

@mikeharder

Import is failing in v15.

test.mjs

Copied from https://github.com/APIDevTools/json-schema-ref-parser/blob/main/README.md#example

import $RefParser from "@apidevtools/json-schema-ref-parser";

console.log($RefParser.dereference);

v14 - Expected

$ npm i @apidevtools/json-schema-ref-parser@14.2.1

$ node test.mjs

[Function: dereference]

v15 - Failing

$ npm i @apidevtools/json-schema-ref-parser@15.1.0

$ node test.mjs

node:internal/modules/esm/resolve:204
  const resolvedOption = FSLegacyMainResolve(pkgPath, packageConfig.main, baseStringified);
                         ^

Error: Cannot find package '/tmp/jsrp/node_modules/@apidevtools/json-schema-ref-parser/index.js' imported from /tmp/jsrp/test.mjs
    at legacyMainResolve (node:internal/modules/esm/resolve:204:26)
    at packageResolve (node:internal/modules/esm/resolve:778:12)
    at moduleResolve (node:internal/modules/esm/resolve:858:18)
    at defaultResolve (node:internal/modules/esm/resolve:990:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:757:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:734:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:317:38)
    at #link (node:internal/modules/esm/module_job:208:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v24.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions