From 9d9802b343fee74383bad2ddde69a8d0e315e8fc Mon Sep 17 00:00:00 2001 From: Minh Nguyen Cong Date: Thu, 27 Aug 2026 15:19:38 +0200 Subject: [PATCH] fix: resolve keytar directory in postinstall script Use require.resolve to locate @github/keytar instead of a hardcoded node_modules path, so the build directory is removed reliably across install layouts. Co-authored-by: Cursor --- src/postinstall.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/postinstall.js b/src/postinstall.js index 0899a56a..990ce970 100644 --- a/src/postinstall.js +++ b/src/postinstall.js @@ -3,7 +3,11 @@ const fs = require('node:fs'); const path = require('node:path'); -fs.rmSync(path.join('node_modules', '@github', 'keytar', 'build'), { +const keytarDir = path.dirname( + require.resolve('@github/keytar/package.json') +); + +fs.rmSync(path.join(keytarDir, 'build'), { recursive: true, force: true, });