In my case removing the package "@types/mongoose": "^5.11.97" helped, because as it says in npm this package is deprecated and "Mongoose publishes its own types, so you do not need to install this package.
" (https://www.npmjs.com/package/@types/mongoose)
It probably caused some conflicts.