Fixing VS2017 Typescript build error

Written by Mathew Grabau -

Fixing Visual Studio Typescript errors

After creating a new Typescriptr project in VS and trying to build it, the following error was constantly displayed:

"Build:Cannot find type definition file for 'angular'." (and then another few hundred of the same except with other packages).

After reading the documentation for Typescript, the following addition to tsconfig.json fixed the problem:

{
    "compilerOptions": {
// ... leaving out a bunch of the options here. The following options must be added.
        "typeRoots": [
                "./Scripts/typings/node",
                "./typings/globals"
            ]
    }
}

The paths specified under typeRoots are the ones applicable to the express project that I had generated.

For reference, the TypeScript version was configured as 2.3.

Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
The error has been logged in /anchor/errors.log
Uncaught Exception

Uncaught Exception

Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Origin

anchor/routes/site.php on line 280

Trace

#0 [internal function]: System\Error::shutdown()
#1 {main}