From 970f34053d8294ec99b5cf86c5a6055eb6fcea72 Mon Sep 17 00:00:00 2001 From: Philip Germanov Date: Tue, 15 Oct 2024 18:16:21 +0300 Subject: [PATCH] fix: change npm cache dir --- cmd/npmExecuteTests.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/npmExecuteTests.go b/cmd/npmExecuteTests.go index f9d78d04a3..72e7d20335 100644 --- a/cmd/npmExecuteTests.go +++ b/cmd/npmExecuteTests.go @@ -37,6 +37,10 @@ func runNpmExecuteTests(config *npmExecuteTestsOptions, c command.ExecRunner) er c.SetEnv([]string{path}) } + if err := c.RunExecutable("npm", "config", "set", "cache", "~/.npm-cache", "--global"); err != nil { + return fmt.Errorf("failed to set npm cache directory: %w", err) + } + installCommandTokens := strings.Fields(config.InstallCommand) if err := c.RunExecutable(installCommandTokens[0], installCommandTokens[1:]...); err != nil { return fmt.Errorf("failed to execute install command: %w", err)