NPM/Yarn Cache Keeps Growing


I’ve had my ghost blog running for some time, rolling through a number of upgrades and one reinstallation over the past years.

Version: 3.0.2
Default configuration - no code changes from base.
Browser isn’t relevant for my problem.
No errors.

I’m installed on Linux Mint and my issue is as follows:

The cache folder in my home directory contains a folder for Yarn. Directory structure looks like this (only showing one module “acorn” as example - there are thousands of others in the v4 folder):


The server it runs on is reporting this folder as one of the largest, clocking in at over 2.6GB. This is a rolling cache that never clears automatically.

Ghost is the only application I have which uses NPM.

Housekeeping for this is super easy - head over to and follow instructions to install Yarn, then run

yarn cache clean

OR, as I discovered after combing documentation

ghost buster

In a production environment dedicated to Ghost, this is something which I think could perhaps get called after a ghost update is installed, in much the same way as old versions of Ghost itself get automatically cleaned up.


Kind Regards, Pete

1 Like