yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.73k forks source link

Commands for yarn files /tmp flood 1.22.19 #8939

Open jcruz97 opened 1 year ago

jcruz97 commented 1 year ago

Hello everyone,

If for some reason (likely you because are an infra/backend without front knowledge) you cannot update yarn to v2, just throw these commands in your server tmp folder (once or in a cronjob) :

find . -maxdepth 1 -name 'yarn--REPLACE_BY_ID*' -exec rm -rf {} +

It will delete all files with the id 's (e.g yarn--1674) that causes your tmp to go full (more likely between 02-03 AM) and crashing everything.

You can also check if the command is working : df -vh

If this helps someone glad to help.

ticmaisdev commented 1 year ago

yarn set version stable

this should update yarn to v3, which supposedly doesn't have this issue anymore?

jcruz97 commented 1 year ago

yarn set version stable

this should update yarn to v3, which supposedly doesn't have this issue anymore?

It's an old project that uses a lot of old versions of packages and I don't have the time to learn/update all of them. Until frontend team updates the project, the cron will take care of the issue. Maybe you don't need to update each package for yarn but I compare it to PHP where a composer update can make a lot of mess in old packages.

And that was a quick fix for my sanity :smile:

ticmaisdev commented 1 year ago

updating yarn didn't work for me, in the end... I've used your command with crontab:

* * * * * find /tmp -maxdepth 1 -name 'yarn--*' -exec rm -rf {} +

that was a quick fix for my sanity, as well