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; }