lukeed / tsm

TypeScript Module Loader
MIT License
1.19k stars 19 forks source link

Run error under node v14.5.0 version #11

Closed kukudeshiyi closed 3 years ago

kukudeshiyi commented 3 years ago

Hi, I am using tsm under node v14.5.0 version and the following error is reported

image

So I tried to switch to another node version v16.11.1. As a result, the ts file was successfully executed and the result was printed

image

TrySound commented 3 years ago

14.5 is very old version which could have problems with esm support. The latest lts is 14.18.1 https://nodejs.org/en/

lukeed commented 3 years ago

Right, 14.10 or 14.14 (forget which) is the first version that actually shipped with the finalized ESM resolver. That's the final design and is what it supported by LTS, hence 16.x working as expected. Adding caveats for dead/outdated resolver versions isn't helpful and is something the ESM effort will have to be okay with since early versions of 13 & 14 had slightly different import/"exports" behavior -- and most of 12.x had nothing at all.

Recommend upgrading to a more recent version of Node 14

kukudeshiyi commented 3 years ago

Ok i see, thanks for the explanation