Nodejs原生运行ts并完美编译npminstall-Dtsx typescript然后,运行如下命令:npx tsx main.ts举个栗子:constmessage="hello world"console.log(message)