Why am I getting "mongoose.connect is not a function" when trying to connect with mongoose?
Replace:
import * as mongoose from "mongoose";
With:
import mongoose from "mongoose";
This worked for me: replace
import * as mongoose from "mongoose";
with
import mongoose = require("mongoose");
if you have "esModuleInterop": true,
in your tsconfig.json it forces you to import mongoose differently so change the above option or change the way you import mongoose