about summary refs log tree commit diff
path: root/pkgs/build-support/node
diff options
context:
space:
mode:
authorLily Foster <lily@lily.flowers>2023-10-07 17:51:52 -0400
committerGitHub <noreply@github.com>2023-10-07 17:51:52 -0400
commit57087b8346c6ae1cf6814d5208646ff29f8e3fde (patch)
tree914d856f14a5a47fb57ed6b235969e32ccc40440 /pkgs/build-support/node
parent6282564d8aae7fca2a744f82ca2fc0029a27552f (diff)
parent30992a8c51b2b257a00464fc27935c023773e06d (diff)
Merge pull request #255984 from SuperSandro2000/patch-1
build-npm-package: give a hint when npm prune fails
Diffstat (limited to 'pkgs/build-support/node')
-rw-r--r--pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
index 64ddcbd567fce..903dbc7eef0c9 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
+++ b/pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
@@ -34,7 +34,16 @@ npmInstallHook() {
 
     if [ ! -d "$nodeModulesPath" ]; then
         if [ -z "${dontNpmPrune-}" ]; then
-            npm prune --omit=dev --no-save ${npmWorkspace+--workspace=$npmWorkspace} $npmPruneFlags "${npmPruneFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"
+            if ! npm prune --omit=dev --no-save ${npmWorkspace+--workspace=$npmWorkspace} $npmPruneFlags "${npmPruneFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}"; then
+              echo
+              echo
+              echo "ERROR: npm prune step failed"
+              echo
+              echo 'If npm tried to download additional dependencies above, try setting `dontNpmPrune = true`.'
+              echo
+
+              exit 1
+            fi
         fi
 
         find node_modules -maxdepth 1 -type d -empty -delete