1.安装 报错
安装 npm install -g ts-node 后执行 ts-node hello.ts报错:
解决:
npm install -D tslib @types/node
重新执行:ts-node hello.ts
2.运行报错:
TSError: ⨯ Unable to compile TypeScript:
hello.ts:107:22 - error TS7006: Parameter 'query' implicitly has an 'any' type.
107 function filterItems(query) {
解决:加上函数类型注解