You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to run resolve against a library which had an invalid main field in package.json.
With require.resolve(), the error message is:
> require.resolve('mylib')
Uncaught:
Error: Cannot find module '/home/me/code/cv-website/node_modules/mylib/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:322:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:683:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1007:27)
at Function.resolve (internal/modules/cjs/helpers.js:78:19) {
code: 'MODULE_NOT_FOUND',
path: '/home/me/code/cv-website/node_modules/mylib/package.json',
requestPath: 'mylib'
}
With resolve, it is:
> resolve.sync('mylib')
Uncaught Error: Cannot find module 'mylib' from '.'
at Function.resolveSync [as sync] (/home/me/code/cv-website/node_modules/resolve/lib/sync.js:89:15) {
code: 'MODULE_NOT_FOUND'
}
Missing error information was critical in my use case, and it took some time to figure out why resolve was failing.
The text was updated successfully, but these errors were encountered:
I tried to run
resolve
against a library which had an invalidmain
field inpackage.json
.With
require.resolve()
, the error message is:With
resolve
, it is:Missing error information was critical in my use case, and it took some time to figure out why
resolve
was failing.The text was updated successfully, but these errors were encountered: