Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`yarn add` installs stale version of local .tgz

I am using yarn to install a package from a .tgz. When I update the package and install it again, yarn uses an old cached version of the package. Here is a report from someone running into a similar problem. If I try to delete the package from the cache, it gives me errors, and if I use yarn cache clean it will clear the whole cache, which is also not what I want.

The reason the package is changing is that I am developing it, and don't want to bump the version number every five minutes. I read maybe newer yarn versions take the package hash into account when installing, but I am stuck with version 1.22.1 (actually jlpm which is JupyterLab's vendored version of yarn).

Is there a way to say yarn add package-0.1.0.tgz --dont-use-cache? Or should I just skip yarn and use npm, or something else on top?

like image 785
jdm Avatar asked Oct 18 '25 06:10

jdm


1 Answers

I know it is a bit late, but if someone stumbles upon this topic. I finally get working by removing the .tmp folder in the yarn cache directory.

rm -rf ~/Library/Caches/Yarn/v6/.tmp/*
yarn cache clean your-package

To get the yarn cache directory run the following cmd:

yarn cache dir
like image 109
Štefan Bartoš Avatar answered Oct 22 '25 14:10

Štefan Bartoš



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!