Open giovannicalo opened 2 years ago
When a Node module binary is run in a folder containing a file called node.js, on Windows, that file will be opened instead of the binary.
node.js
This happens due to Windows' PATHEXT environment variable containing .JS.
PATHEXT
.JS
The issue was originally fixed in 8b1433c26aabf0d38b70a3fec6162dfd699fad24, but it has reappeared in c0396463c1730e812b1d4c461871aa7d0961ccef.
Currently, endlocal is called after editing PATHEXT but before invoking Node, so the latter is not affected by it.
endlocal
My solution edits PATHEXT after calling endlocal, thus affecting the Node invocation and fixing the issue.
The only downside is the Node process will receive the edited PATHEXT, which however must've been the original behaviour anyway.
When a Node module binary is run in a folder containing a file called
node.js
, on Windows, that file will be opened instead of the binary.This happens due to Windows'
PATHEXT
environment variable containing.JS
.The issue was originally fixed in 8b1433c26aabf0d38b70a3fec6162dfd699fad24, but it has reappeared in c0396463c1730e812b1d4c461871aa7d0961ccef.
Currently,
endlocal
is called after editingPATHEXT
but before invoking Node, so the latter is not affected by it.My solution edits
PATHEXT
after callingendlocal
, thus affecting the Node invocation and fixing the issue.The only downside is the Node process will receive the edited
PATHEXT
, which however must've been the original behaviour anyway.