using TS 2.0 Beta I can't get the new @types working. somewhere in my code:
import * as angular from 'angular';
TS 2.0 @types:
npm install --save @types/angular
tsc
the compiler doesn't find the d.ts files though: Error:(1, 26) TS2307: Cannot find module 'angular'.
no issues with current (old) method of using the typings tool and global (before ambient) dependencies.
I expected the d.ts lookup to work automatically with 2.0 as described here:
https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/
perhaps I am missing something?
I was having the same issue with another file - tsc didn't find node_modules/@types/es6-shim. Explicitly adding types to tsconfig.json helped:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmit": true,
"types":["es6-shim"],
"sourceMap": true,
"target": "es5"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With