From 301386770209a734cc7c64918a39136a74c83d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Wed, 9 Apr 2025 22:51:34 +0200 Subject: [PATCH] pnpm.configHook: improve error message when install fails due to old hash --- .../tools/pnpm/fetch-deps/pnpm-config-hook.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh b/pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh index 09652b8c6965..f66f06c0a867 100644 --- a/pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh +++ b/pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh @@ -44,11 +44,23 @@ pnpmConfigHook() { runHook prePnpmInstall - pnpm install \ + if ! pnpm install \ --offline \ --ignore-scripts \ "${pnpmInstallFlags[@]}" \ --frozen-lockfile + then + echo + echo "ERROR: pnpm failed to install dependencies" + echo + echo "If you see ERR_PNPM_NO_OFFLINE_TARBALL above this, follow these to fix the issue:" + echo '1. Set pnpmDeps.hash to "" (empty string)' + echo "2. Build the derivation and wait for it to fail with a hash mismatch" + echo "3. Copy the 'got: sha256-' value back into the pnpmDeps.hash field" + echo + + exit 1 + fi echo "Patching scripts"