From 2df7d23edb7bc4d4f5fffc929cb313e9edeecbef Mon Sep 17 00:00:00 2001 From: Elie Habib Date: Tue, 10 Mar 2026 08:27:44 +0400 Subject: [PATCH] fix(dx): add node_modules guard to pre-push hook and pin Node 22 (#1368) Worktrees start with no node_modules, causing tsc to fail with misleading TS2307 errors. The guard auto-runs npm install on first push. .nvmrc pins Node 22 to match CI and avoid Node 24 compat issues. --- .husky/pre-push | 6 ++++++ .nvmrc | 1 + 2 files changed, 7 insertions(+) create mode 100644 .nvmrc diff --git a/.husky/pre-push b/.husky/pre-push index 255c86d32..a26d61b7b 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,3 +1,9 @@ +# Ensure dependencies are installed (worktrees start with no node_modules) +if [ ! -d node_modules ]; then + echo "node_modules missing, running npm install..." + npm install --prefer-offline || exit 1 +fi + echo "Running type check..." npm run typecheck || exit 1 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..2bd5a0a98 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22