File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
1717 STDIN_NAME ,
1818 REPL_FILENAME ,
1919} from './repl' ;
20- import { VERSION , TSError , register } from './index' ;
20+ import { VERSION , TSError , register , versionGteLt } from './index' ;
2121import type { TSInternal } from './ts-compiler-types' ;
2222import { addBuiltinLibsToObject } from '../dist-raw/node-cjs-helpers' ;
2323
@@ -431,10 +431,7 @@ function requireResolveNonCached(absoluteModuleSpecifier: string) {
431431 // On those node versions, pollute the require cache instead. This is a deliberate
432432 // ts-node limitation that will *rarely* manifest, and will not matter once node 12
433433 // is end-of-life'd on 2022-04-30
434- const [ major , minor ] = process . versions . node
435- . split ( '.' )
436- . map ( ( v ) => parseInt ( v , 10 ) ) ;
437- const isSupportedNodeVersion = major >= 13 || ( major == 12 && minor > 1 ) ;
434+ const isSupportedNodeVersion = versionGteLt ( process . versions . node , '12.2.0' ) ;
438435 if ( ! isSupportedNodeVersion ) return require . resolve ( absoluteModuleSpecifier ) ;
439436
440437 const { dir , base } = parsePath ( absoluteModuleSpecifier ) ;
You can’t perform that action at this time.
0 commit comments