Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter command to delete packages in .pub-cache folder

How to delete the flutter packages in .pub-cache folder? When we give flutter clean, it will delete the build folder in the current directory. We can delete it manually, but my requirement is to delete the packages in .pub-cache folder using the command.

like image 210
Dharanidharan Avatar asked Oct 09 '19 13:10

Dharanidharan


People also ask

Can I delete pub-cache in flutter?

Clearing the global system cache To clear your system cache with an older SDK, you can manually delete the PUB_CACHE folder.

How do I clean my flutter package?

When we give flutter clean , it will delete the build folder in the current directory. We can delete it manually, but my requirement is to delete the packages in . pub-cache folder using the command.

Where is pub-cache folder in flutter?

By default, this directory is located under . pub-cache in your home directory (on macOS and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows).


1 Answers

If a dependency is removed from the pubspec and then pub get is run, it removes the dependency from the .packages file, making the dependency unavailable for importing.

If a packages in your pub cache to change or break, you can use flutter pub cache repair command performs a clean reinstall of all hosted and git packages in the system cache.

like image 74
victwise Avatar answered Sep 21 '22 06:09

victwise