You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo 1 > a && ls -l a
# -rw-rw-r-- 1 admin admin 2 Aug 24 18:29 a
node -e "fs.writeFileSync('./a', 'echo world', {mode: 0o755})"&& ls -l a
# -rw-rw-r-- 1 admin admin 10 Aug 24 18:29 a
./a
# bash: ./a: Permission denied
Even we specify the mode to be 0o755, fs.writeFileSync still doesn't change to file mode which is 0o644.
So the installer which uses fs.writeFileSyncL63 won't make esbuild executable.
This is a default behavior on POSIX when trying to write Buffer to an existing file.
This is true. However, how does this behavior manifest when you install esbuild? What are the steps to reproduce the problem you are experiencing, and on what system?
This is true. However, how does this behavior manifest when you install esbuild? What are the steps to reproduce the problem you are experiencing, and on what system?
I cusomized a npm installer, it would change the esbuild/bin/esbuild to default 0o644 when writing files into disk, and esbuild postinstall tries to overwrite bin/esbuild using a platform-specific npm package (e.g. esbuild-linux-arm64).
In this case, bin/esbuild won't have the 0o755 pemissions, so it's better to chmod than writeFile with mode 0o755.
Even we specify the mode to be
0o755
,fs.writeFileSync
still doesn't change to file mode which is0o644
.So the installer which uses
fs.writeFileSync
L63 won't makeesbuild
executable.This is a default behavior on POSIX when trying to write Buffer to an existing file.
PR#1547 shall fix it.
The text was updated successfully, but these errors were encountered: