I've installed spotify-web-api-node into my npm TypeScript project to retrieve data about tracks because you need an API token for that for some reason. This package seems to use superagent, which uses a shaded/included mime package. (I can find the package in the stacktrace under /node_modules/superagent/node_modules/mime)
When trying to run my project, when superagent imports mime, it executes Mime.define which finally throws TypeError: typeMap[type].map is not a function. I have no idea why this is happening. I found someone having a similar issue but they were able to fix it by simply doing:
rm -rf node_modules package-lock.json
npm install
Which didn't work for me.