You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ts-node/register not found when using global install #3
The hook should run, and ts-node/register should be found as it was in older Node.js versions or when installed locally.
Additional context
This is not just a Node.js 22+ issue; even with Node.js 20, global modules are not resolved for the -r flag unless you are in a directory with a local install.
The workaround is to use the absolute path to the global ts-node/register/index.js, but this is not ergonomic.
Installing ts-node locally in the working directory also works, but is not always desirable.
Environment
Node.js: v22.15.0 and v20.12.2
ts-node: 10.9.2 (globally installed)
OS: macOS
Possible solutions
Document this Node.js behavior and recommend using the absolute path or local install.
Consider supporting a config option for specifying the preload path.
Activity
timoconnellaus commentedon Jul 9, 2025
I think I have resolved this in the 1.4.6 update @ariburaco
ariburaco commentedon Jul 11, 2025
Thanks, I was testing with the global level
hooks.user.ts. May I ask have you deprecated that feature? @timoconnellaus