Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 4229d94

Browse files
authored
fix(npm): allow multiple NPM_FLAGS during new install execution (#900)
1 parent 3449ee7 commit 4229d94

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

run-build-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ run_npm() {
264264
then
265265
echo "Bypassing sha validation. Running pre & post install scripts"
266266
echo "Installing npm packages using npm version $(npm --version)"
267-
if npm install ${NPM_FLAGS:+"$NPM_FLAGS"}
267+
if npm install ${NPM_FLAGS:+$NPM_FLAGS}
268268
then
269269
echo "npm packages installed"
270270
else

tests/node/bypass_cache.bats

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load '../../node_modules/bats-assert/load'
77
load '../../node_modules/bats-file/load'
88

99
setup() {
10-
10+
1111
NETLIFY_CACHE_DIR="/opt/buildhome/cache"
1212
TMP_DIR=$(setup_tmp_dir)
1313
NODE_VERSION=14
@@ -31,3 +31,9 @@ teardown() {
3131
run run_npm "buildbot_other_flags"
3232
assert_output --partial "Creating package sha"
3333
}
34+
35+
@test 'bypass_cache can handle multiple NPM_FLAGS' {
36+
NPM_FLAGS="--no-audit --legacy-peer-deps"
37+
run run_npm "buildbot_other_flags"
38+
refute_output --partial "audit"
39+
}

0 commit comments

Comments
 (0)