Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn offline cache strange behavior

Tags:

npm

yarnpkg

I'm having trouble setting up my yarn configs to work behind the proxy. In fact, I'm simply supposed to set up the offline cache like it is told in this tutorial. That's what I do, and it perfectly works on my machine that is connected to internet, even when connection is off.

But when I take the cache, put it on the machine behind the proxy, and set up configs like I did just before on the other computer, it breaks when used. I get this error message:

there should only be one folder in a package cache (got )

I've been googling that, and yarn github open (and closed!) issues for hours, without success. What does that (got <space>) means? In the yarn-error.log file, no more informations are shown. I double checked my npm-packages-offline-cache and there are only .tgzs (not tagged as dirs, of course) in it (I did ll -a of course).

Did anyone ever hear of it? Or is it a known bug (among many others) of this yarn thing? Thanks for considering my request.

like image 512
V. Courtois Avatar asked Feb 25 '19 18:02

V. Courtois


People also ask

Should .Yarn be ignored?

. yarn/unplugged should likely always be ignored since they typically hold machine-specific build artifacts. Ignoring it might however prevent Zero-Installs from working (to prevent this, set enableScripts to false ).

Can Yarn work offline?

Offline. Yarn creates a cached copy which facilitates offline package installs. Therefore you can install your npm packages without an internet connection with Yarn.

How do I clear my Yarn cache?

when you run yarn cache dir from the command line, it will print out the path where yarn's global cache is currently stored. When you run the yarn cache clean [<module_name...>] command, it will clear the global cache. The global cache will then be repopulated when next you run yarn or yarn install.

What is offline cache?

Offline caching enables your application to read data from local cache if network is not available.


1 Answers

Not sure about this - I'm researching similar issues. But this seemed to make this one go away

yarn cache clean

like image 96
Mark Swardstrom Avatar answered Sep 23 '22 07:09

Mark Swardstrom