在使用ts-node执行ts代码,会报错
TSError: ⨯ Unable to compile TypeScript:
Demo1.ts:3:5 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
3 console.log(aaa);
~~~~~~~
解决方法:
npm install -D tslib @types/node
————————————————