Closed Badisi closed 7 months ago
I am also getting this when using tree-sitter's package-npm workflow. Exact same issue, only happening when building for windows 64bit. Not an issue for macOS and linux ubuntu
Which Node.js versions have this issue? Only 20?
@vweevers It relates to versions 18 and 20, which received some security fixes.
PR is welcome to add shell: true
. We might want to investigate why it happens, but shell
shouldn't have side effects AFAICT so that's a good short-term fix.
Same as @derevnjuk, I can confirm the issue exists with node 18 and 20.
As for the side effects, I can also confirm that using shell: true
on every platforms worked fine in my case (so no side effects).
@Badisi It seems it only affects Windows x86, but I'm not sure. Have you tested it?
@derevnjuk,
Yes, my github action is running on macos-latest:x64
, ubuntu-latest:x64
, windows-latest:x64
and windows-latest:x86
, and only windows-latest:x86 was failing.
Adding shell: true
was enough to make it work and had no impacts on the other platforms.
@Badisi, thanks! 🙏🏾 I have opened the PR and am waiting for the review and feedback.
@vweevers the root cause is straightforward: Node.js team forbids the use of .bat
and .cmd
without the shell option, as seen here: https://github.com/nodejs/node/commit/6627222409. For details, please refer to the following issues: https://github.com/nodejs/node/issues/52470 and https://github.com/node-red/node-red/pull/4652.
Which Node.js versions have this issue? Only 20?
21.7.3 is what's used in my workflow
Could you please provide an update on this issue? I believe this, along with the similar issue prebuild/node-gyp-build#68, should be considered critical bugs.
Issue
I'm playing with the following github action:
The main idea is to run prebuildify on
macos-latest:x64
,ubuntu-latest:x64
,windows-latest:x64
andwindows-latest:x86
.Everything works fine except for the
windows-latest:x86
where I get the following issue:Investigation
The code in
prebuildify index.js:230
is:After debugging I can see that the actual value used for
opts.nodeGyp
is "node-gyp.cmd":Solution
There seems to have some issues with
spawn
on Windows and most of the time people suggests to useshell: true
to solve it.So I monkey patched the previous code in prebuildify like this:
and it indeed solved the issue.