MCPcopy Index your code
hub / github.com/nodejs/node / createEsmNotFoundErr

Function createEsmNotFoundErr

lib/internal/modules/cjs/loader.js:1624–1633  ·  view source on GitHub ↗

* Creates an error object for when a requested ES module cannot be found. * @param {string} request The name of the requested module * @param {string} [path] The path to the requested module * @returns {Error}

(request, path)

Source from the content-addressed store, hash-verified

1622 * @returns {Error}
1623 */
1624function createEsmNotFoundErr(request, path) {
1625 // eslint-disable-next-line no-restricted-syntax
1626 const err = new Error(`Cannot find module '${request}'`);
1627 err.code = 'MODULE_NOT_FOUND';
1628 if (path) {
1629 err.path = path;
1630 }
1631 // TODO(BridgeAR): Add the requireStack as well.
1632 return err;
1633}
1634
1635function getExtensionForFormat(format) {
1636 switch (format) {

Callers 4

resolveExpansionFunction · 0.85
resolveExportsFunction · 0.85
loader.jsFile · 0.85
finalizeEsmResolutionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…