title: Basic Setup for Typescript Types - Cannot find name 'angular'
body: <p>My team is working on an older AngularJS project that we have recently upgraded to .Net Core 3.1 while the project works fine without it we would like to start upgrading our scripts to use TypeScript.  None of us have actually used Typescript before and I'm sure we have something very basic messed up in our config.</p>
  
  <p>I've set up a demo project which can be found here:
  <a href="https://github.com/ExcaliburVT/TypeScriptBasic" rel="nofollow noreferrer">https://github.com/ExcaliburVT/TypeScriptBasic</a></p>
  
  <p>The project has libman references for angularjs, angular material, bootstrap etc along with their appropriate TypeScript "typings" (at least I think they are correct).
  Here: <a href="https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/libman.json" rel="nofollow noreferrer">https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/libman.json</a></p>
  
  <p>Our tsconfig.json is exactly like this:
  <a href="https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/tsconfig.json" rel="nofollow noreferrer">https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/tsconfig.json</a></p>
  
  <pre><code>{
    "compilerOptions": {
      "noImplicitAny": true,
      "noEmitOnError": true,
      "removeComments": false,
      "sourceMap": true,
      "target": "es6",
      "moduleResolution": "Node",
  
  
      "baseUrl": "wwwroot",
      "typeRoots": ["./lib/types"]
    },
    "include": [
      "wwwroot/Scripts/**/*"
    ],
    "exclude": [ "node_modules", "**/*.spec.ts" ],
    "compileOnSave": true
  }
  
  </code></pre>
  
  <p>Finally I have created two example ts files with different ways of trying to reference angular.</p>
  
  <p><a href="https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/wwwroot/Scripts/exampleOne.ts" rel="nofollow noreferrer">https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/wwwroot/Scripts/exampleOne.ts</a>
  //TS2304(TS) Cannot find name 'angular'
  //TS2503(TS) Cannot find namespace 'ng'</p>
  
  <p><a href="https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/wwwroot/Scripts/exampleTwo.ts" rel="nofollow noreferrer">https://github.com/ExcaliburVT/TypeScriptBasic/blob/master/wwwroot/Scripts/exampleTwo.ts</a>
  //TS2688(TS) Cannot find type definition file for 'angular'</p>
  
  <p>Going to the extreme if we ADD the path to the types folders in the "include" of tsconfig.json the libraries appear to be found, but then we get compiler errors for the types themselves.  </p>
  
  <p>I'm certain its something quite simple that we have setup wrong but i'm out of ideas.  </p>
  
  <h2>Thanks in advance!</h2>
  
  <p>Additional Testing.  Note that setting the paths directly doesn't appear to work either.</p>
  
  <pre><code>"baseUrl": "wwwroot",
      "paths": {
        "angular": [ "lib/types/angular" ],
        "angular-material": [ "lib/types/angular-material" ],
        "bootstrap": [ "lib/types/bootstrap" ],
        "jquery": [ "lib/types/jquery" ]
      }
  </code></pre>