github / licensed

A Ruby gem to cache and verify the licenses of dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

meenie opened this issue · 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 👋 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, 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!