fix(plugins): ignore install scripts during plugin/hook install

This commit is contained in:
Peter Steinberger
2026-02-09 21:33:10 -06:00
parent cfd112952e
commit 92702af7a2
5 changed files with 129 additions and 9 deletions

View File

@@ -278,10 +278,13 @@ async function installPluginFromPackageDir(params: {
const hasDeps = Object.keys(deps).length > 0;
if (hasDeps) {
logger.info?.("Installing plugin dependencies…");
const npmRes = await runCommandWithTimeout(["npm", "install", "--omit=dev", "--silent"], {
timeoutMs: Math.max(timeoutMs, 300_000),
cwd: targetDir,
});
const npmRes = await runCommandWithTimeout(
["npm", "install", "--omit=dev", "--silent", "--ignore-scripts"],
{
timeoutMs: Math.max(timeoutMs, 300_000),
cwd: targetDir,
},
);
if (npmRes.code !== 0) {
if (backupDir) {
await fs.rm(targetDir, { recursive: true, force: true }).catch(() => undefined);