Skip to content

Local dependencies should not be cached #2033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bsideup opened this issue Nov 25, 2016 · 4 comments
Open

Local dependencies should not be cached #2033

bsideup opened this issue Nov 25, 2016 · 4 comments

Comments

@bsideup
Copy link

bsideup commented Nov 25, 2016

When dependency is defined as:

        "my-dep": "file:./my-dep/"

Yarn shouldn't cache it because it might be changed locally.

Right now Yarn 0.17.8 does it and the changes are not applied.

@markstos
Copy link
Contributor

I agree this dependency shouldn't be cached, not because it's local but because there is no version number required in the dependency. I would expect this work like a git repo, where the "latest" version is thus presumed the desired version.

@notpushkin
Copy link

Git dependencies also shouldn't be cached IMO, because they might be modified/patched versions, not desired in other projects. For example, in one project, I'm installing react from https://github.com/preact-compat/react (which just resolves it to preact-compat), while in some other projects I want to use actual React instead. If preact-compat/react was some other version than 0.1.0, I'd be doomed.

@eTorAken
Copy link

Related to #2165

@mdebeus
Copy link

mdebeus commented Apr 16, 2019

Currently yarn caches so many versions of our local library that it is just ridiculous. Yarn cache clean crashes, and manually deleting the directory (last deletion was a month ago) takes about an hour - this on an SSD. Also, the entire library is cached, node_modules and all. Our build server ran out of inodes - we have to clean the cache after every build of each of our packages - libraries and apps. At one point we had a local library that depended on another local library and that was really bad. We will be adding some new local libraries, so this problem is just going to get worse.

Definitely not ideal.

It was suggested to use yarn link --> we do use yarn link, but these libraries are still cached. For the build server, we cannot use yarn link, so this is not option.
It was suggested to use workspaces, but this does not work for us. We have 6-7 react apps (that use react scripts) all using this same local library - all of our apps live under Client/apps/{appName} while our library lives under Client/common. We would need a workspaces directory for every application - which seems like a lot of work just to mitigate this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants