Using ts-node to Execute .ts files Error [Solved]

When learning typescript, you want to execute the TS file. First install the TS package, then use the TSC command to execute it, compile it into a JS file, and use node xxx.js to execute it. However, this is troublesome. Later, you want to use TS node to directly execute it and simplify the steps. An error is reported:

It is found that the corresponding package needs to be installed to compile:

Solution:
 
npm install -D tslib @types/node

Read More: