Merge pull request #21401 from backstage/rugvip/version

cli: tweak check for when to use module register API
This commit is contained in:
Patrik Oldsberg
2023-11-19 00:38:04 +01:00
committed by GitHub
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',