-
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 install
ignores files
from local dependencies
#2822
yarn install
ignores files
from local dependencies
#2822
Comments
yarn install
ignores files
from local pathyarn install
ignores files
from local dependencies
I suspect this may be a common error across other resolvers as well. Normally when you npm publish a package, only the items listed in (you can verify this by setting up an offline cache directory and For other resolvers, it's going to have to filter on its own. I did a quick search through the yarn source and didn't see anything that would be doing that check (though I could have missed it). |
@rally25rs |
Confirming @rally25rs's suspicion: this issue appears to also affect installation from GitHub using the I suppose publishing with |
For private git repositories, if npm is able to filter packages by reading the files:[] property, shouldn't yarn be doing the same ? |
We face exactly the same problem with a dependency we're pulling directly out of our private corporate git repository. Any idea when this will be fixed? |
Has there been any progress made on this? |
just out of curiosity, is there any plan to change this behaviour? I've just run into a situation where I need one specific file from private repo A as an import in private repo B, but the file I need is created as part of repo A's build step, so I don't need the other 5MB of stuff that it contains... I've created a |
Not sure if it's related, but I'm experiencing a situation where yarn ignores You can see the
{
"name": "react-cosmos-test",
"version": "4.0.0-beta.0",
"description": "APIs for testing Cosmos fixtures in headless environments",
"repository": "https://github.com/react-cosmos/react-cosmos/tree/master/packages/react-cosmos-test",
"license": "MIT",
+ "files": [
+ "lib",
+ "enzyme.js",
+ "generic.js"
+ ],
"dependencies": {
"react-cosmos-config": "^4.0.0-beta.0",
"react-cosmos-loader": "^4.0.0-beta.0",
"react-cosmos-shared": "^4.0.0-beta.0",
"traverse": "^0.6.6"
},
"xo": false
}
package
package/enzyme.js
package/generic.js
package/lib
package/package.json
+package/src
package/lib/enzyme.js
package/lib/generic.js
+package/src/__tests__
+package/src/enzyme.js
+package/src/generic.js
+package/src/__tests__/enzyme.js
+package/src/__tests__/generic.js I appreciate any help with this one as it's annoying for react-cosmos users to download unnecessary source files, which among other things can cause Flow errors in the dependent project. Thanks! |
Hi everyone, I'm going to fix it. After the initial research I have two questions. I plan to modify https://github.com/yarnpkg/yarn/blob/master/src/fetchers/copy-fetcher.js#L10, and then I have several options: Option one:
Option two:
Which one is better? And the second question – does doing it in the fetcher make sense? @BYK @kittens I will appreciate your feedback on how to proceed here. |
This problem occurs to me when depending on local packages using Yarn workspaces, too. Could someone please confirm if this is the same issue? Or should I create a new issue for yarn workspaces specifically? E.g. workspace/packages/a has
If this is a separate issue please let me know so I can create it. |
Any word on this? I am running into this when developing a package the specifies the babel transpiled |
experiencing the same issue |
any update on this? |
I'm having same issue, trying to test a package before publishing and using folder reference yarn gets all the contents including |
@merceyz this has been tagged as "fixed-in-v2" but it is not (v2.4.0). When I specify a dep as |
This is still an issue on yarn 1.23.0. Tried yarn 2 and it did not appear to be fixed there either as hl037 states. |
Any updates on this? As of now I am still encountering this issue. I am trying to install a private package in a project and only need the /dist folder in the package, but also have some other dependencies in the same repo that I am using for the documentation of the package, that I dont want in the project I am using the package in. It's particularly annoying that this feature works fine with npm, but not with yarn. |
So... this might be insanely silly but I added a |
Awesome that worked! Thank you |
@akramer24 In my experience, this only works for git repos. Was that your use case? No solutions nor workarounds yet for local dependencies... |
It was a git repo in my case |
Looks like there's been a PR open for this issue since last year. Can someone with access get around to merging it please? This is not a novel use case and should be supported because npm supports it. |
FYI (and no idea why this decision was thought to be good or why they still allow issues to be open here) this repo is no longer maintained and the new version is over here: https://github.com/yarnpkg/berry Trying to upgrade has been an absolute mess with yarn and we have since moved back to npm and it has fixed all of our issues. Unfortunately I do think yarn has shot itself in the foot by messing up the upgrade path & moving to a different repository but thats the beauty of open source :) |
There is a long standing issue with yarn always including all files even though it is not included in `files` field in package.json. Relevant discussion here: yarnpkg/yarn#2822 (comment)
There is a long standing issue with yarn always including all files even though it is not included in `files` field in package.json. Relevant discussion here: yarnpkg/yarn#2822 (comment)
There is a long standing issue with yarn always including all files even though it is not included in `files` field in package.json. Relevant discussion here: yarnpkg/yarn#2822 (comment)
There is a long standing issue with yarn always including all files even though it is not included in `files` field in package.json. Relevant discussion here: yarnpkg/yarn#2822 (comment)
because yarn ignores "files" field in package.json yarnpkg/yarn#2822
because yarn ignores "files" field in package.json yarnpkg/yarn#2822
What is the current behavior?
It seems that
yarn install
ignoresfiles
frompackage.json
of projects that are locally depended on.If the current behavior is a bug, please provide the steps to reproduce.
Using two simple projects that depends on each other locally:
project1
specifies which files should be copied by dependent projects:project2
depends onproject1
locally:npm install
inproject2
only copies the good file:However,
yarn install
copies everything, ignoringfiles
:What is the expected behavior?
Same behavior as
npm
.Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: