We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
NODE_PATH
1 parent 87c08f1 commit b857e6fCopy full SHA for b857e6f
bin/webpack-dev-server.js
@@ -58,6 +58,18 @@ const isInstalled = (packageName) => {
58
// eslint-disable-next-line no-cond-assign
59
} while (dir !== (dir = path.dirname(dir)));
60
61
+ // https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274
62
+ // @ts-ignore
63
+ for (const internalPath of require("module").globalPaths) {
64
+ try {
65
+ if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) {
66
+ return true;
67
+ }
68
+ } catch (_error) {
69
+ // Nothing
70
71
72
+
73
return false;
74
};
75
0 commit comments