在使用npm过程中,肯定会遇到清缓存的情况,网上的帖子抄来抄去的,还都是无效的,真的是一言难尽。废话不多说,直接上代码!

npm cache clean --force

下面代码是验证缓存是否清除,Index entries:0表示清除完毕!

npm cache verify

下面是我的执行情况,请参考

fy@YFdeMacBook-Pro pc_vue % npm cache clear --force


npm WARN using --force Recommended protections disabled.
fy@YFdeMacBook-Pro pc_vue % npm cache verify
Cache verified and compressed (~/.npm/_cacache)
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.004s

清除成功! 

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐