-
Notifications
You must be signed in to change notification settings - Fork 2.7k
ignore-optional flag works not like expected #2666
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
Comments
👍 here.
Using Here's how I'd expect things to work: If this flag is set in a local If the flag is not set Thanks! |
Just ran into. Was surprised it didn't work for |
Optional deps should still be resolved and saved in lockfile but they should not be installed with this flag. |
@BYK, I've reaised the priority to get it on your radar, feel free to lower as you see fits. |
rm -rf foo
(
mkdir -p foo/a && cd foo/a
echo '{"name":"a", "version":"1.0.0", "dependencies": {"b":"file:../b"}}' > package.json
)
(
mkdir -p foo/b && cd foo/b
echo '{"name":"b", "version":"1.0.0", "dependencies": {"c":"file:../c"}}' > package.json
)
(
mkdir -p foo/c && cd foo/c
echo '{"name":"c", "version":"1.0.0", "optionalDependencies": {"d":"file:../d"}}' > package.json
)
(
mkdir -p foo/d && cd foo/d
echo '{"name":"d", "version":"1.0.0", "dependencies": {}}' > package.json
)
(
cd foo/a
~/yarn/bin/yarn --ignore-optional
tree
) |
@bestander Is there any way to avoid optional dependencies being added to the lockfile? We have an issue with the |
@bestander So if we have a private git repo that not everyone can access, optional dependencies are not where we should keep that? (yarn tried to |
@patcon for your builds to be deterministic, at least all recursive dependency information for all the packages used should be available to all yarn builds (or you can opt for locking the lock file with |
Interesting... I wonder if it might be possible to manually supply package.json files somehow... or is that too hacky? As in, YES, I am 100% in favour of deterministic builds taking absolute precedence for all that they unlock, but seems awkward to not be able to circumnavigate a private repo for optional/dev[/peer?] dependencies. Or perhaps this is already possible with If you feel there's merit in this, please just say the word and I will poof a new issue :) But no worries if not. Thanks so much for your consideration (At the very least, I suppose I'm just banking the idea above in case some future traveller is looking for a possible solution :) |
Do you want to request a feature or report a bug?
Bug / feature ?
What is the current behavior?
yarn install --ignore-optional
tries to install also optional dependencies of sub modules. The while install process fails if one of the optional module installation fails.What is the expected behavior?
To skip the optional dependencies of sub modules or to continue on errors.
Please mention your node.js, yarn and operating system version.
Node 7.5.0, Yarn v0.19.1, Ubuntu 14.04
The text was updated successfully, but these errors were encountered: