-
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 is not deterministic when adding a new package to an existing project vs. a clean install #3363
Comments
That sucks, we need to fix it, thanks for the steps |
What is the error message? |
|
I think I know the reason. The error you see is probably caused by a breaking change in a library (babel-loader?). |
I have a similar problem with my project. https://github.com/dantix/waterly/tree/eslint-airbnb I've made a diff of file tree and there is a difference in how Repro:
|
Thanks for repro steps
…On Sun, 14 May 2017 at 20:36, Roman Holovin ***@***.***> wrote:
I have a similar problem with my project.
https://github.com/dantix/waterly/tree/eslint-airbnb
If I do a clean install, eslint is not working properly. If I install
eslint 3.15.0 first, then update it to the 3.19.0 - it will work properly.
I've made a diff of file tree and there is a difference in how eslint
dependency is included in modules.
In my case, after clean install eslint-config-airbnb has empty
node_modules directory, after downgrade and upgrade eslint, it has eslint
in local node_modules with 3.16.1 version.
*Repro*:
cd /tmp
git clone ***@***.***:dantix/waterly.git
cd waterly
git checkout eslint-airbnb
yarn
yarn lint # there should be a lot of errors
yarn add ***@***.***
yarn add ***@***.***
yarn lint # there should be a handful of warnings
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3363 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWN3n059PxE1kfooZLtez7rSRGiYXks5r51ekgaJpZM4NWbwk>
.
|
@bestander maybe I found why it is not deterministic: when we prepare the requests (https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/add.js#L39) for the command |
Thanks. IIRC here https://github.com/yarnpkg/yarn/blob/master/src/package-request.js#L245 the optimization of yarn.lock happens and unused resolutions are getting left out. |
When running |
Should be fixed in 0.27.2 👍 |
If you start with a clean create-react-app (v1.2.1) project, yarn installs
babel-loader
but its dependencybabel-core
is moved to the top-level node_modules so that it can be shared by all packages.When you then add the two packages
react-svg-loader
andsvg-react-loader
yarn keeps the top-levelbabel-core
, so thatbabel-loader
continues to use that version (v6.22.1).However when you remove all dependencies (
rm -rf node_modules
) and let yarn install everything afresh, it will installbabel-core
v6.13.2 as a private dependency ofbabel-loader
, which is incompatible with other packages.Steps to reproduce
The text was updated successfully, but these errors were encountered: