licensed icon indicating copy to clipboard operation
licensed copied to clipboard

The `cache` command is not cleaning up stale license files

Open meenie opened this issue 2 years ago • 2 comments

When running bin/licensed cache, it is not cleaning up stale license files. For example, we recently updated @rails/webpacker to a newer version that not longer relies on node-sass. After doing so and observing that node-sass is no longer inside of our yarn.lock file, running the cache command does not delete the node-sass license file.

We do have multiple apps configured in our .licensed.yml file as we have a monorepo, could it be that?

meenie avatar Jan 03 '23 20:01 meenie

@meenie :wave: are you able to provide either a minimal project to reproduce the issue, or at a minimum your licensed configuration file, package.json and yarn.lock files, and the version of yarn you're using? I don't have a clear idea of what's going wrong based on the issue description alone 😞

jonabc avatar Jan 04 '23 15:01 jonabc

@jonabc, sorry for not getting back to you. I figured out why it's not deleting files. When you run bin/licensed cache and you have yarn dependencies, you are gonna have a bad time :). Especially on Ubuntu when you don't need the fsevents library because it's usually set to optional. As you pointed out in another issue, yarn sucks at listing what deps are installed as it reports optional deps as installed when they are not. So there are errors at the end which means it doesn't do the cleanup. Good times!

meenie avatar Jul 13 '23 03:07 meenie