1

Can I use both type of modules in a single node project and difference between these type of npm modules :

npm install @types/express vs npm install express

  • 1
    [What is the meaning of the β€œat” (@) prefix on npm packages?](https://stackoverflow.com/questions/36667258) and [Use of @ symbol in Node module names](https://stackoverflow.com/questions/36293481) – adiga Dec 27 '19 at 08:14
  • This is not a duplicate of those questions because it seems to be a misunderstanding of the meaning of the `@types` scope specifically. i.e. And that is different because one does not reference those packages directly and they are layed out on definitely typed based on how one is expected to import the packages they describe – Aluan Haddad Sep 14 '20 at 03:54

1 Answers1

3

Modules starting with @types are typescript type definitions only, you can't run code only with types, you need implementation too. In your case npm install express installs the implementation. If you install only implementation, you won't have types. In some cases both ship inside single package.

You can compare them by yourself:

Type definitions for express

Express implementation

karaxuna
  • 26,752
  • 13
  • 82
  • 117