From d289fcea09068f70bf63f7ac7091dc982757ba73 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 26 Sep 2024 17:50:53 -0400 Subject: [PATCH] Add --ignore-scripts flag to Node project installs Signed-off-by: Timothy Johnson --- .../dependency-scan/src/actions/base/InstallAction.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/licenses/dependency-scan/src/actions/base/InstallAction.ts b/licenses/dependency-scan/src/actions/base/InstallAction.ts index 295742f..6ae6c51 100644 --- a/licenses/dependency-scan/src/actions/base/InstallAction.ts +++ b/licenses/dependency-scan/src/actions/base/InstallAction.ts @@ -88,15 +88,15 @@ export class InstallAction implements IAction { //default npm install prod let installCmd = "npm"; let installArgs = ["install", "--omit=dev", ...registry]; - + if (Utilities.hasPnpmLockFile(`${absDir}`)) { installCmd = "pnpm"; - installArgs = ["install", "--frozen-lockfile", "--prod", ...registry] + installArgs = ["install", "--frozen-lockfile", "--prod", "--ignore-scripts", ...registry] } else if (Utilities.hasNpmLockfile(`${absDir}`)) { - installArgs = ["ci", "--omit=dev", ...registry] + installArgs = ["ci", "--omit=dev", "--ignore-scripts", ...registry] } else if (Utilities.hasYarnLockfile(`${absDir}`)) { installCmd = "yarn"; - installArgs = ["install", "--production", "--frozen-lockfile", "--ignore-engines", ...registry] + installArgs = ["install", "--production", "--frozen-lockfile", "--ignore-engines", "--ignore-scripts", ...registry] } if (fs.existsSync(path.join(absDir, "node_modules"))) {