Search code examples
node.jstypescriptnpmnestjs

Uninstall package from @types in node_modules


I have library ('mime') in my node_modules, I want to uninstall this from my project including its @types files. The reason I am doing this is I want to replace it with a new mime package as the old one doesn't work for me.

I tried to remove using npm uninstall mime. I even tried it with --save and --save-dev and also as Mime (Capitalized). I have also tried uninstalling from @types/mime directly. I want a working command for as deleting it directly sounds risky. Please let me know what am I doing wrong here. npm was also useless here


Solution

  • I think it might be issue of your node cache you can follow the below steps

    1. First try the command npm uninstall @types/mime
    2. Still it's not deleted then check your package.json file and remove that package name from your dependencies
    3. If still not work then remove it from your node module folder
    4. If still not work then clear your node cache.