Got on the same trap.
Following the tutorial you can access the repo and see from where he imports the basicAuth function
Tutorial: https://medium.com/@a16n.dev/password-protecting-swagger-documentation-in-nestjs-53a5edf60fa0
import * as basicAuth from 'express-basic-auth';