-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Description
- Version: v12.4.0
- Platform: macOS 10.14.5
- Subsystem: module
In an empty directory, install lodash then from the REPL run the following commands. The second command fails if you pass an empty options object.
> require.resolve('lodash')
'/Users/lloyd/Documents/tmp/require-resolve/node_modules/lodash/lodash.js'
> require.resolve('lodash', {})
Thrown:
Error: Cannot find module 'lodash'
Require stack:
- <repl>
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
at Function.resolve (internal/modules/cjs/helpers.js:21:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '<repl>' ]
}
If the options value is {}
or { paths: undefined }
I would expect it to be ignored and the built-in defaults used.
This issue breaks a few of my apps in node >= 12.3.
Metadata
Metadata
Assignees
Labels
No labels