pnpm.configHook: improve error message when install fails due to hash (#397491)

authored by scrumplex.net and committed by GitHub 12d4e48d a660d955

+13 -1
+13 -1
pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh
··· 44 45 runHook prePnpmInstall 46 47 - pnpm install \ 48 --offline \ 49 --ignore-scripts \ 50 "${pnpmInstallFlags[@]}" \ 51 --frozen-lockfile 52 53 54 echo "Patching scripts"
··· 44 45 runHook prePnpmInstall 46 47 + if ! pnpm install \ 48 --offline \ 49 --ignore-scripts \ 50 "${pnpmInstallFlags[@]}" \ 51 --frozen-lockfile 52 + then 53 + echo 54 + echo "ERROR: pnpm failed to install dependencies" 55 + echo 56 + echo "If you see ERR_PNPM_NO_OFFLINE_TARBALL above this, follow these to fix the issue:" 57 + echo '1. Set pnpmDeps.hash to "" (empty string)' 58 + echo "2. Build the derivation and wait for it to fail with a hash mismatch" 59 + echo "3. Copy the 'got: sha256-' value back into the pnpmDeps.hash field" 60 + echo 61 + 62 + exit 1 63 + fi 64 65 66 echo "Patching scripts"