dknaack
dknaack

Reputation: 60556

Typescript Definitions from Node Modules

I am trying to configure typescript with my tsconfig.json so it does find definitions inside node_modules.

Ive read that it should work if i set the module to commonjs despite excluding node_modules.

I tried to remove the exclude. Tried to include manually but nothing works.

How to configure typescript to find definition files installed with the source npm package?

Upvotes: 0

Views: 903

Answers (1)

WatersLake
WatersLake

Reputation: 1282

[email protected] (Recommended)

You may use npm install. Example:

npm install --save @types/<your package name>

[email protected] Use tsd package: https://github.com/DefinitelyTyped/tsd

I also have node.js + [email protected] + mongodb + passportjs example right there: https://github.com/thanhtruong0315/typescript-express-passportjs.

Upvotes: 1

Related Questions