by Sai gowtham

How to clear the Cache in Npm

In this tutorial, we are going to learn about how to clear or remove the cache from npm.

When we install a package using the npm install <package-name> command npm stores the cache inside the user file system.

The default cache directory is ~/.npm on Posix (mac or linux), or %AppData%/npm-cache on Windows.

Clearing the cache

To clear a cache in npm, we need to run the npm cache clean --force command in our terminal.

npm cache clean --force

clean: It deletes the all data from your cache folder.

You can also verify the cache, by running the following command.

npm cache verify

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
130,921 students enrolled
48.5 hours of video content
View Course