Skip to content

fix: surfaces outdated node version error [LSDK-343] - #28

Merged
Hari Harish (harisaiharish) merged 2 commits into
mainfrom
hariharish/node-version-guard
Jul 16, 2026
Merged

fix: surfaces outdated node version error [LSDK-343]#28
Hari Harish (harisaiharish) merged 2 commits into
mainfrom
hariharish/node-version-guard

Conversation

@harisaiharish

Copy link
Copy Markdown
Collaborator

Problem

Cursor launches hooks from a GUI context, so the node it runs is not your shell's version-managed node (nvm/mise/asdf) — it's whatever is on the system PATH, often an old node or none. The hooks import node:sqlite, which needs Node ≥ 22.13. On older node that import throws at module-load before any of our code runs, so tracing fails silently: no log line, no trace, turn_count stuck at 0.

Fix

Route every hook through a small version guard (node ./bundle/guard.js <hook-name>) that:

  • checks process.versions.node first, and
  • only then dynamically imports the real hook (a static import would be hoisted and crash before the check).

If node is too old, it writes a clear message to stderr + ~/.cursor/langsmith-hook.log (including the exact node binary Cursor used) and exits 0, so failures are loud instead of silent — no scary per-turn hook error.

Changes: new src/utils/node-version.ts (+ unit tests) and src/hooks/guard.ts; both hooks.json files repointed through the guard; esbuild bundles guard.js; README troubleshooting section added.

Notes

  • This surfaces the error. It does not make old-node machines trace, and it can't help machines where no node is found at all (node never starts, so no JS runs).
  • Upgrading your shell's nvm/mise node won't fix a Dock/Finder-launched Cursor. That node isn't on the GUI PATH. Users need Node ≥ 22.13 on the system PATH, or to launch Cursor from a terminal. A version-manager-aware launcher (issue Marketplace hooks fail under nvm #27) is the follow-up that would actually fix both cases.

@harisaiharish Hari Harish (harisaiharish) changed the title fix: surfaces outdated node version error fix: surfaces outdated node version error [LSDK-343] Jul 15, 2026
Bump version and rebuild bundle. Ships the Node version guard that surfaces
outdated-node errors instead of failing silently. Also realigns
.cursor-plugin/plugin.json (was 0.3.0) with package.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@harisaiharish
Hari Harish (harisaiharish) merged commit 3746ae0 into main Jul 16, 2026
5 checks passed
@harisaiharish
Hari Harish (harisaiharish) deleted the hariharish/node-version-guard branch July 16, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants