Looking at your package.json
, you're using Express version 4, but you have the @types/express
for Express 5. These won't match up.
"express": "^4.21.2",
"@types/express": "^5.0.0",
In your devDependencies
, change this line:
"@types/express": "^5.0.0",
to this
"@types/express": "^4.17.21",
and then reinstall your packages (npm install
or yarn install
).
Express v5 is in next
, so when you do npm install express
, you get v4, but DefinitelyTyped
(where the @types/*
come from) has v5 published as latest
, so when you do npm install @types/express
, you get v5. That means on fresh projects, you'll have to be specific until either Express5 gets fully released or DefinitelyTyped updates their npm tags.