diff --git a/.changes/cli.js-node-shim.md b/.changes/cli.js-node-shim.md new file mode 100644 index 00000000000..fd230dae6ee --- /dev/null +++ b/.changes/cli.js-node-shim.md @@ -0,0 +1,5 @@ +--- +"cli.js": patch +--- + +Fix crash when nodejs binary has the version in its name, for example `node18` diff --git a/tooling/cli/node/tauri.js b/tooling/cli/node/tauri.js index e934c2ef1d3..4503db9a965 100755 --- a/tooling/cli/node/tauri.js +++ b/tooling/cli/node/tauri.js @@ -12,7 +12,7 @@ let binName // Even if started by a package manager, the binary will be NodeJS. // Some distribution still use "nodejs" as the binary name. -if (binStem === 'node' || binStem === 'nodejs') { +if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) { const managerStem = process.env.npm_execpath ? path.parse(process.env.npm_execpath).name.toLowerCase() : null