Rick
Rick

Reputation: 8846

Upgraded to TSC 2.0.0- node modules aren't resolved by VS Code syntax checker

The Problem

enter image description here

Setup

I was running tsc 1.8 this morning. I upgraded to tsc 2.0.0 later.

VS Code 1.4.0 6276dcb0ae497766056b4c09ea75be1d76a8b679

Node 5.10.0

tsc -v: === "Version 2.0.0"

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "jsx": "react",
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "noUnusedLocals": true,
    "strictNullChecks": true
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "buildOnSave": false
}

Full project source code here. Disclaimer: it's a fairly large codebase.

Upvotes: 1

Views: 197

Answers (1)

Rick
Rick

Reputation: 8846

I was able to solve the problem by adding the following to /.vscode/settings.json:

{
    "typescript.tsdk": "node_modules/typescript/lib",
}

Upvotes: 1

Related Questions