We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
NODE_MAJOR
NODE_MINOR
1 parent 9a57643 commit 9fb250eCopy full SHA for 9fb250e
packages/node-core/src/utils/detection.ts
@@ -1,4 +1,5 @@
1
import { consoleSandbox } from '@sentry/core';
2
+import { NODE_MAJOR, NODE_MINOR } from '../nodeVersion';
3
4
/** Detect CommonJS. */
5
export function isCjs(): boolean {
@@ -19,8 +20,7 @@ export function supportsEsmLoaderHooks(): boolean {
19
20
return false;
21
}
22
- const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number);
23
- if (nodeMajor >= 21 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {
+ if (NODE_MAJOR >= 21 || (NODE_MAJOR === 20 && NODE_MINOR >= 6) || (NODE_MAJOR === 18 && NODE_MINOR >= 19)) {
24
return true;
25
26
0 commit comments