-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
yarn probably shouldn't cache packages resolved with a file path #2165
Comments
This fooled me as well. There must be a way to get around this without clearing all the cache. I think there could the three ways to make yarn usable for this case:
I'd like to see the second suggestion to be implemented. Unless, the third option could be useful for other cases as well. For instance, |
@hantuzun why cache local dependencies at all? they are local anyways, so it will be fast regardless cached or not. |
@satya164 you're right. Although, I'm more inclined to the third approach would help if a dependency from network is modified intentionally. |
Something like |
Can someone explain me the internal logic? My understanding: |
@bestander or @kittens Maybe you could explain this a little bit more...? Would love to get a little help to create a PR ♥ |
Hash means the md5 hash that is used for tarball-fetcher, for example. |
Okay, thank you for your response. Should I ping you as a reviewer in the PR or should I ping someone else (or no one)...? |
Yeah, ping me |
@bestander probably this issue shouldn't be closed since it's not fixed yet? |
Yes, it should be re-opened. It was closed because I wrote " fixes #2165" in the title of my PR. In the beginning I thought it would be an ongoing PR, but to fix this bug we want two PRs: the first one added a unit test (the assertion which would fail is not really active, so CI doesn't blow up) and the second one will actually fix it. |
Sorry, github closes issues when PR is merged |
…g#2165 (yarnpkg#2443) * added failing unit test for yarnpkg#2165 * fixed unit test * updated unit test
so obviously this is still a problem? it's quite annoying to develop with, to be honest. it's causing a bit of a disruption for me on a personal level at work, where i'm making use of editing the contents of my eslint-config-base-eslint package
|
Everyone is welcome to contribute to the project. |
I actually think that the fix should be 10-15 lines of code, it will probably save a lot of time fixing it sooner |
Can we reopen this issue? We are facing the same problem. Two projects referencing another package via file:. After some builds in our CI/CD server, the cache folder is starting to occupy a lot of space. |
I think the link protocol is the best fix for this, file:// doesn't work since it still requires manually clean caches & force installing just make your dependency something like this
|
@alxtz does links protocol works with packages in tgz? |
Thanks for this this replicates the behaviour of NPM which will symlink |
Sadly, For example, I need a shared/peer dependency from my SDK package, which when I make changes, I would link for local dev work. I've been using I forked the repo and put an extra clause in the if statement to stop yarn from ever loading a local .tgz package from its cache if it's specified using
I can make a PR if people want it, though I've never done that before and it's a pretty hacky fix. |
@souporserious That is exactly what I needed/wanted, thank you so much! |
Insane this is still an issue after so many years. |
Is it fixed in yarn@2.x? |
@wKich I believe so! I haven't personally tested it, but it looks like they solve local development through the new portal protocol. |
I still get "unpack in same destination" error using the
|
This issue is not fixed by the |
Why is this closed? |
Believe it or not, it's still an issue with yarn berry (3+). I wish there were better alternatives to deal with devDeps. |
It is actually 4+ years #6037 |
Due to [this](yarnpkg/yarn#2165) and similar issues, yarn doesn't refresh the local cache, and prevents local package updates.
When developing a package with React 18 I had various issues using |
due to some caching implemented by yarn, application does not update local dependencies (cleaning up node_modules seems to be the only way to trigger a code update when I regen the aocwasm) why is slightly annoying. Using the link: protocol fixes the issue. It will symlink the wasm build directly into the node_modules directly. This gives us live updates - way better. ref: yarnpkg/yarn#2165 (comment)
Do you want to request a feature or report a bug?
I guess a bug.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
Say you have the following project structure:
With the following files:
component-foo/package.json
:component-foo/index.js
:yarn-test/package.json
:Now you run
$ yarn install
insideyarn-test/
andyarn-test/node_modules/component-foo/index.js
is:Now remove
yarn-test/node_modules/
andyarn-test/yarn.lock
and changecomponent-foo/index.js
to this:Now you run
$ yarn install
insideyarn-test/
again andyarn-test/node_modules/component-foo/index.js
will be:It uses the cached version of
component-foo
, butcomponent-foo/index.js
has changed.What is the expected behavior?
I'd expect that
yarn-test/node_modules/component-foo/index.js
should be this at the end:Maybe packages installed with local paths like
file:../
shouldn't be cached at all, if we can't figure out, if they have changed.(FYI: It looks like npm doesn't cache them.)
Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: