cli: tweak check for when to use module register API

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-18 14:15:08 +01:00
parent a72a1b7b25
commit 8cda3c72f2
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Tweaked Node.js version check for when to use the new module register API with the new backend `package start` command.
@@ -28,7 +28,8 @@ import { paths } from '../paths';
import spawn from 'cross-spawn';
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
const supportsModuleLoaderRegister = nodeMajor >= 20 && nodeMinor >= 6;
const supportsModuleLoaderRegister =
nodeMajor > 20 || (nodeMajor === 20 && nodeMinor >= 6);
const loaderArgs = [
'--require',