pnpmConfigHook: disable version management before any execution of pnpm commands

This would prevent hanging when pnpm tries to download the version set in package.json.
This commit is contained in:
ccicnce113424 2026-03-25 02:43:41 +08:00
commit 4f0a7d184a

View file

@ -17,6 +17,12 @@ pnpmConfigHook() {
exit 1
fi
# If the packageManager field in package.json is set to a different pnpm version than what is in nixpkgs,
# any pnpm command would fail in that directory, the following disables this
pushd $HOME
pnpm config set manage-package-manager-versions false
popd
echo "Found 'pnpm' with version '$(pnpm --version)'"
fetcherVersion=$(cat "${pnpmDeps}/.fetcher-version" || echo 1)
@ -37,13 +43,6 @@ pnpmConfigHook() {
chmod -R +w "$STORE_PATH"
# If the packageManager field in package.json is set to a different pnpm version than what is in nixpkgs,
# any pnpm command would fail in that directory, the following disables this
pushd $HOME
pnpm config set manage-package-manager-versions false
popd
pnpm config set store-dir "$STORE_PATH"
# Prevent hard linking on file systems without clone support.