[BUG] Loading TS config files when `--experimental-strip-types` is enabled still requires `ts-node`
Author: satazorCreated May 25, 2026Updated Jun 3, 2026
Describe the bug
When --experimental-strip-types is enabled (enabled by default in recent node versions), loading config files written in TypeScript fail with Error: Cannot find module 'ts-node'.
Expected behavior
Loading TypeScript config files should work out of the box when --experimental-strip-types is enabled. In fact, if I comment this code, I'm able to load config correctly, without the extra dependency.
Parser.tsParser = function(filename, content) {
// if (!require.extensions['.ts']) {
// require(TS_DEP).register({
// lazy: true,
// ignore: ['(?:^|/)node_modules/', '.*(?<!\.ts)$'],
// transpileOnly: true,
// compilerOptions: {
// allowJs: true,
// }
// });
// }One possible solution is to check process.features.typescript === 'strip', and also skip loading ts-node if it evaluates to true.
Please tell us about your environment:
- node-config version:
4.0.0 - node-version:
24.14.0
Source: node-config/node-config