npm ts-node 10.8.0

latest release: 10.8.1
one month ago

Questions about this release? Ask in the official discussion thread: #TODO


  • Added support for module=NodeNext, module=Node16, .mts, .cts, .mjs, and .cjs file extensions (#1414, #1694, #1744, #1745, #1727, #1717, #1753, #1757) @cspotcode
  • Added ability to include file extensions in CommonJS imports (#1727, #1753) @cspotcode
    • Enables consistency with ESM, where file extensions are often mandatory
  • Resolves from emitted to source file extensions (#1727, #1753) @cspotcode
    • Must enable experimentalResolver, will be enabled by default in a future version (docs)
    • Typechecker requires importing the emitted file extension; ts-node resolves correctly to the source file. E.g. import "./foo.js" will execute foo.ts See also: TypeScript issue #37582
    • If typechecking is disabled, you can also use source file extensions. E.g. import "./foo.ts"
  • Added experimentalSpecifierResolution (#1727, #1753) @cspotcode
    • the same as Node's --experimental-specifier-resolution (Node docs)
    • can also be specified in tsconfig.json for convenience, to avoid the CLI flag
    • allows omitting file extensions in ESM imports, plus a few other CommonJS-style conveniences
  • Adds diagnostics property to TSError, with array of TypeScript diagnostic objects from the compiler (API docs) (#1705, #1706) @paulbrimicombe


  • Renames option experimentalResolverFeatures to experimentalResolver (docs) (#) @cspotcode
  • Internal change to ESM loader for compatibility with forthcoming node versions: returns shortCircuit: true (#1714, #1715) @cspotcode
  • Performance: Optimize filesystem stat calls in ESM loader and new CommonJS resolver (#1758, #1759) @cspotcode
  • Performance, maintenance: Upgrade source-mapper dependency "@cspotcode/source-map-support"
    • Switches to "trace-mapping" for underlying source-map parsing (#1729) @cspotcode


  • Fixed bug where REPL .type command was not showing any type information when using TypeScript nightly builds (#1761, #1762) @cspotcode
  • Correctly suppress "Custom ESM Loaders" warning on newer node versions where the warning's prose changed (#1701) @cspotcode
  • Fixed REPL bug where function signatures could not be entered across multiple lines (#1667, #1677) @d9k
  • REPL treats unparenthesized object literals as objects, instead of as block scopes (#1697, #1699) @jhmaster2000
  • Fixed bug where preferTsExts combined with third-party transpiler hooks could disrupt nyc code coverage (#1755) @cspotcode
  • Fixed bug where file:// URLs in stack traces did not always use percent-encoding (#1738, #1726, #1729) @cspotcode
  • Fixed bug where v8-compile-cache-lib did not correctly unhook itself (#1717, #1718, #1719) @cspotcode
    • This internal dependency is used to speed up loading the TypeScript compiler



Discussion thread template

Discussion thread for the v10.8.0 release.

Release notes

Don't miss a new ts-node release

NewReleases is sending notifications on new releases.