express-basic-auth icon indicating copy to clipboard operation
express-basic-auth copied to clipboard

[BUG] error TS2688: Cannot find type definition file for 'express'.

Open Miniontoby opened this issue 2 years ago • 2 comments

Hi, I added this to my project and it gives me an error whilst building my TS file.

$ npm run build
> [email protected] build
> tsc

node_modules/express-basic-auth/express-basic-auth.d.ts:1:23 - error TS2688: Cannot find type definition file for 'express'.

1 /// <reference types="express" />
                        ~~~~~~~


Found 1 error in node_modules/express-basic-auth/express-basic-auth.d.ts:1

Can someone maybe help to come up with a solution or patch?

  • Miniontoby

Miniontoby avatar Jun 20 '23 17:06 Miniontoby

The current types depend on you having express types installed as well. The current type setup is generally in need of an overhaul, but that will only be solved with v2 as it will probably need to break some current behaviours.

LionC avatar Sep 28 '23 13:09 LionC

What package to install for the express types?

Cause when I install @types/express it gives me more errors about this package...

Miniontoby avatar Sep 29 '23 06:09 Miniontoby