排除node_modules时出现打字稿错误

时间:2019-03-19 21:35:29

标签: typescript

这是我的tsconfig

{
   "compilerOptions": {
      "target": "es2017",
      "module": "commonjs",
      "moduleResolution": "node",
      "outDir": "./dist",
      "baseUrl": ".",
      "allowSyntheticDefaultImports": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "sourceMap": true,
      "lib": [
         "es7",
         "es2017"
      ]
   },
   "include": [
      "src/**/*.ts"
   ],
   "exclude": [
      "node_modules"
   ]
}

当我尝试构建ts文件时,我得到

> tsc

node_modules/@types/better-sqlite3/index.d.ts(14,55): error TS1005: ';' expected.
node_modules/@types/better-sqlite3/index.d.ts(14,79): error TS1005: '=' expected.

是什么原因导致此问题,该如何解决?我在排除中提到了node_modules

0 个答案:

没有答案