From e2013a5096f3cd53baee2e40f9de56a3b057df18 Mon Sep 17 00:00:00 2001 From: phaer Date: Fri, 10 Jan 2025 12:37:32 +0100 Subject: [PATCH] importNpmLock: fix check for .bin in linkNodeModulesHook node_modules/.bin/ is expected to be (symlink to) a directory rather than a regular file, so we check for that. This seems to work for pre-existing directories as well as those we link to the store (managed & unmanaged in the hooks terminology). I am not entirely sure whether the original check was simply a typo or intentional for some use-cases. --- .../node/import-npm-lock/hooks/link-node-modules-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/node/import-npm-lock/hooks/link-node-modules-hook.sh b/pkgs/build-support/node/import-npm-lock/hooks/link-node-modules-hook.sh index 12f2f8507fa5..f03ec073f2f6 100644 --- a/pkgs/build-support/node/import-npm-lock/hooks/link-node-modules-hook.sh +++ b/pkgs/build-support/node/import-npm-lock/hooks/link-node-modules-hook.sh @@ -7,7 +7,7 @@ linkNodeModulesHook() { fi @nodejs@ @script@ @storePrefix@ "${npmDeps}/node_modules" - if test -f node_modules/.bin; then + if test -d node_modules/.bin; then export PATH=$(readlink -f node_modules/.bin):$PATH fi