Skip to content

Commit 4bf7bc6

Browse files
committed
pnpm.fetchDeps: ignore packageManager field in package.json
1 parent e9b255a commit 4bf7bc6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkgs/development/tools/pnpm/fetch-deps/default.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@
6868
fi
6969
7070
export HOME=$(mktemp -d)
71+
72+
# If the packageManager field in package.json is set to a different pnpm version than what is in nixpkgs,
73+
# any pnpm command would fail in that directory, the following disables this
74+
pushd ..
75+
pnpm config set manage-package-manager-versions false
76+
popd
77+
7178
pnpm config set store-dir $out
7279
# Some packages produce platform dependent outputs. We do not want to cache those in the global store
7380
pnpm config set side-effects-cache false

pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ pnpmConfigHook() {
2020
cp -Tr "$pnpmDeps" "$STORE_PATH"
2121
chmod -R +w "$STORE_PATH"
2222

23+
24+
# If the packageManager field in package.json is set to a different pnpm version than what is in nixpkgs,
25+
# any pnpm command would fail in that directory, the following disables this
26+
pushd ..
27+
pnpm config set manage-package-manager-versions false
28+
popd
29+
2330
pnpm config set store-dir "$STORE_PATH"
2431

2532
if [[ -n "$pnpmWorkspace" ]]; then

0 commit comments

Comments
 (0)