Skip to content

Commit

Permalink
fix(cli/node): fix invoking the node cli from a shim, closes #193 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 4, 2022
1 parent 0b09cc1 commit 09c0ed6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/cli-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-tauri-app-js": "patch"
---

Fix crash when nodejs binary has the version in its name, for example `node18`
2 changes: 1 addition & 1 deletion packages/cli/node/create-tauri-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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;
Expand Down

0 comments on commit 09c0ed6

Please sign in to comment.