tsc に node_modules フォルダを無視させるにはどうすればいいですか? 質問する

tsc に node_modules フォルダを無視させるにはどうすればいいですか? 質問する

私はtscビルドタスクを使用しています。残念ながら、ノードモジュールフォルダから常に同じエラーが発生します。

Executing task: .\node_modules\.bin\tsc.cmd --watch -p .\tsconfig.json <
node_modules/@types/node/index.d.ts(6208,55): error TS2304: Cannot find name 'Map'.
node_modules/@types/node/index.d.ts(6215,55): error TS2304: Cannot find name 'Set'.
node_modules/@types/node/index.d.ts(6219,64): error TS2304: Cannot find name 'Symbol'.
node_modules/@types/node/index.d.ts(6225,59): error TS2304: Cannot find name 'WeakMap'.
node_modules/@types/node/index.d.ts(6226,59): error TS2304: Cannot find name 'WeakSet'.
10:13:18 - Compilation complete. Watching for file changes.

すでにディレクトリを無視に追加しましたtsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "sourceMap": true,
    "strict": false,
    "noImplicitAny": false,
    "strictPropertyInitialization": false,
    "esModuleInterop": true,
  },
  "include": [
    "src/*"
  ],
  "exclude": [
    "node_modules",
    "./node_modules",
    "./node_modules/*",
    "./node_modules/@types/node/index.d.ts",
  ]
}

何が間違っているのでしょうか? これらのエラーを無視するにはどうすればいいでしょうか?

私は VSCode と tsc バージョン 2.9.2 を使用しています。

ベストアンサー1

クイックフィックスはチェックをスキップすることです

{
  "compilerOptions": {
    "skipLibCheck": true
  },
}

おすすめ記事