We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 969b4f8 commit d99df4bCopy full SHA for d99df4b
index.js
@@ -64,7 +64,10 @@ if (Module.isBuiltin) { // Added in node v18.6.0, v16.17.0
64
// as the `paths` options argument was added to the `require.resolve` function,
65
// which is the one we want
66
let resolve
67
-if (require.resolve.paths) {
+// require.resolve might be undefined when using Node SEA mode:
68
+// https://nodejs.org/api/single-executable-applications.html
69
+// Also see https://github.com/nodejs/require-in-the-middle/issues/105
70
+if (require.resolve && require.resolve.paths) {
71
resolve = function (moduleName, basedir) {
72
return require.resolve(moduleName, { paths: [basedir] })
73
}
0 commit comments