From 957b5e5994d0e807a43207812ca08acf79502fab Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Fri, 23 Jan 2026 15:40:46 -0600 Subject: [PATCH] fix: ensure binary is executable after npm install (#229) --- .changeset/fix-binary-permissions.md | 5 +++++ scripts/postinstall.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-binary-permissions.md diff --git a/.changeset/fix-binary-permissions.md b/.changeset/fix-binary-permissions.md new file mode 100644 index 0000000..3a6ae17 --- /dev/null +++ b/.changeset/fix-binary-permissions.md @@ -0,0 +1,5 @@ +--- +"agent-browser": patch +--- + +Fix binary permissions on install. npm doesn't preserve execute bits, so postinstall now ensures the native binary is executable. diff --git a/scripts/postinstall.js b/scripts/postinstall.js index f0b6361..e7a7da8 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -68,7 +68,11 @@ async function downloadFile(url, dest) { async function main() { // Check if binary already exists if (existsSync(binaryPath)) { - console.log(`✓ Native binary already exists: ${binaryName}`); + // Ensure binary is executable (npm doesn't preserve execute bit) + if (platform() !== 'win32') { + chmodSync(binaryPath, 0o755); + } + console.log(`✓ Native binary ready: ${binaryName}`); return; }