Skip to content
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

Closed
wereHamster opened this issue May 10, 2017 · 10 comments

Comments

@wereHamster
Copy link

If you start with a clean create-react-app (v1.2.1) project, yarn installs babel-loader but its dependency babel-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 and svg-react-loader yarn keeps the top-level babel-core, so that babel-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 install babel-core v6.13.2 as a private dependency of babel-loader, which is incompatible with other packages.

Steps to reproduce

$ ceate-react-app yarn-bug
$ cd yarn-bug
$ yarn build # works
$ yarn add react-svg-loader svg-react-loader
$ yarn build # works, too
$ rm -rf node_modules
$ yarn
$ yarn build # fails
@bestander
Copy link
Member

That sucks, we need to fix it, thanks for the steps

@bestander
Copy link
Member

What is the error message?

@wereHamster
Copy link
Author

wereHamster commented May 12, 2017

› create-react-app yarn-bug
Creating a new React app in /Users/tomc/yarn-bug.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and react-scripts...

yarn add v0.23.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 769 new dependencies.
├─ abab@1.0.3
├─ abbrev@1.1.0
├─ accepts@1.3.3
├─ acorn-globals@3.1.0
├─ acorn-jsx@3.0.1
├─ acorn@3.3.0
├─ ajv-keywords@1.5.1
├─ ajv@4.11.8
├─ align-text@0.1.4
├─ alphanum-sort@1.0.2
├─ amdefine@1.0.1
├─ ansi-escapes@1.4.0
├─ ansi-html@0.0.5
├─ ansi-regex@2.1.1
├─ ansi-styles@2.2.1
├─ ansicolors@0.2.1
├─ anymatch@1.3.0
├─ append-transform@0.4.0
├─ aproba@1.1.1
├─ are-we-there-yet@1.1.4
├─ argparse@1.0.9
├─ aria-query@0.3.0
├─ arr-diff@2.0.0
├─ arr-flatten@1.0.3
├─ array-equal@1.0.0
├─ array-flatten@1.1.1
├─ array-union@1.0.2
├─ array-uniq@1.0.3
├─ array-unique@0.2.1
├─ arrify@1.0.1
├─ asap@2.0.5
├─ asn1@0.2.3
├─ assert-plus@1.0.0
├─ assert@1.4.1
├─ ast-types-flow@0.0.7
├─ async-each@1.0.1
├─ async@1.5.2
├─ asynckit@0.4.0
├─ autoprefixer@6.7.2
├─ aws-sign2@0.6.0
├─ aws4@1.6.0
├─ babel-code-frame@6.22.0
├─ babel-core@6.22.1
├─ babel-eslint@7.1.1
├─ babel-generator@6.24.1
├─ babel-helper-builder-binary-assignment-operator-visitor@6.24.1
├─ babel-helper-builder-react-jsx@6.24.1
├─ babel-helper-call-delegate@6.24.1
├─ babel-helper-define-map@6.24.1
├─ babel-helper-explode-assignable-expression@6.24.1
├─ babel-helper-function-name@6.24.1
├─ babel-helper-get-function-arity@6.24.1
├─ babel-helper-hoist-variables@6.24.1
├─ babel-helper-optimise-call-expression@6.24.1
├─ babel-helper-regex@6.24.1
├─ babel-helper-remap-async-to-generator@6.24.1
├─ babel-helper-replace-supers@6.24.1
├─ babel-helpers@6.24.1
├─ babel-jest@18.0.0
├─ babel-loader@6.2.10
├─ babel-messages@6.23.0
├─ babel-plugin-check-es2015-constants@6.22.0
├─ babel-plugin-istanbul@3.1.2
├─ babel-plugin-jest-hoist@18.0.0
├─ babel-plugin-syntax-async-functions@6.13.0
├─ babel-plugin-syntax-class-properties@6.13.0
├─ babel-plugin-syntax-exponentiation-operator@6.13.0
├─ babel-plugin-syntax-flow@6.18.0
├─ babel-plugin-syntax-jsx@6.18.0
├─ babel-plugin-syntax-object-rest-spread@6.13.0
├─ babel-plugin-syntax-trailing-function-commas@6.22.0
├─ babel-plugin-transform-async-to-generator@6.24.1
├─ babel-plugin-transform-class-properties@6.22.0
├─ babel-plugin-transform-es2015-arrow-functions@6.22.0
├─ babel-plugin-transform-es2015-block-scoped-functions@6.22.0
├─ babel-plugin-transform-es2015-block-scoping@6.24.1
├─ babel-plugin-transform-es2015-classes@6.24.1
├─ babel-plugin-transform-es2015-computed-properties@6.24.1
├─ babel-plugin-transform-es2015-destructuring@6.23.0
├─ babel-plugin-transform-es2015-duplicate-keys@6.24.1
├─ babel-plugin-transform-es2015-for-of@6.23.0
├─ babel-plugin-transform-es2015-function-name@6.24.1
├─ babel-plugin-transform-es2015-literals@6.22.0
├─ babel-plugin-transform-es2015-modules-amd@6.24.1
├─ babel-plugin-transform-es2015-modules-commonjs@6.24.1
├─ babel-plugin-transform-es2015-modules-systemjs@6.24.1
├─ babel-plugin-transform-es2015-modules-umd@6.24.1
├─ babel-plugin-transform-es2015-object-super@6.24.1
├─ babel-plugin-transform-es2015-parameters@6.24.1
├─ babel-plugin-transform-es2015-shorthand-properties@6.24.1
├─ babel-plugin-transform-es2015-spread@6.22.0
├─ babel-plugin-transform-es2015-sticky-regex@6.24.1
├─ babel-plugin-transform-es2015-template-literals@6.22.0
├─ babel-plugin-transform-es2015-typeof-symbol@6.23.0
├─ babel-plugin-transform-es2015-unicode-regex@6.24.1
├─ babel-plugin-transform-exponentiation-operator@6.24.1
├─ babel-plugin-transform-flow-strip-types@6.22.0
├─ babel-plugin-transform-object-rest-spread@6.22.0
├─ babel-plugin-transform-react-constant-elements@6.22.0
├─ babel-plugin-transform-react-display-name@6.23.0
├─ babel-plugin-transform-react-jsx-self@6.22.0
├─ babel-plugin-transform-react-jsx-source@6.22.0
├─ babel-plugin-transform-react-jsx@6.22.0
├─ babel-plugin-transform-regenerator@6.22.0
├─ babel-plugin-transform-runtime@6.22.0
├─ babel-plugin-transform-strict-mode@6.24.1
├─ babel-preset-env@1.2.1
├─ babel-preset-jest@18.0.0
├─ babel-preset-react-app@2.2.0
├─ babel-preset-react@6.22.0
├─ babel-register@6.24.1
├─ babel-runtime@6.23.0
├─ babel-template@6.24.1
├─ babel-traverse@6.24.1
├─ babel-types@6.24.1
├─ babylon@6.17.1
├─ balanced-match@0.4.2
├─ base64-js@1.2.0
├─ batch@0.5.3
├─ bcrypt-pbkdf@1.0.1
├─ big.js@3.1.3
├─ binary-extensions@1.8.0
├─ block-stream@0.0.9
├─ bluebird@3.5.0
├─ boolbase@1.0.0
├─ boom@2.10.1
├─ brace-expansion@1.1.7
├─ braces@1.8.5
├─ browser-resolve@1.11.2
├─ browserify-aes@0.4.0
├─ browserify-zlib@0.1.4
├─ browserslist@1.7.7
├─ bser@1.0.2
├─ buffer-shims@1.0.0
├─ buffer@4.9.1
├─ builtin-modules@1.1.1
├─ builtin-status-codes@3.0.0
├─ bytes@2.3.0
├─ caller-path@0.1.0
├─ callsites@2.0.0
├─ camel-case@3.0.0
├─ camelcase@3.0.0
├─ caniuse-api@1.6.1
├─ caniuse-db@1.0.30000667
├─ cardinal@1.0.0
├─ case-sensitive-paths-webpack-plugin@1.1.4
├─ caseless@0.12.0
├─ center-align@0.1.3
├─ chalk@1.1.3
├─ chokidar@1.7.0
├─ ci-info@1.0.0
├─ circular-json@0.3.1
├─ clap@1.1.3
├─ clean-css@4.0.13
├─ cli-cursor@1.0.2
├─ cli-table@0.3.1
├─ cli-usage@0.1.4
├─ cli-width@2.1.0
├─ cliui@2.1.0
├─ clone@1.0.2
├─ co@4.6.0
├─ coa@1.0.1
├─ code-point-at@1.1.0
├─ color-convert@1.9.0
├─ color-name@1.1.2
├─ color-string@0.3.0
├─ color@0.11.4
├─ colormin@1.1.2
├─ colors@1.1.2
├─ combined-stream@1.0.5
├─ commander@2.9.0
├─ commondir@1.0.1
├─ compressible@2.0.10
├─ compression@1.6.2
├─ concat-map@0.0.1
├─ concat-stream@1.6.0
├─ connect-history-api-fallback@1.3.0
├─ console-browserify@1.1.0
├─ console-control-strings@1.1.0
├─ constants-browserify@1.0.0
├─ contains-path@0.1.0
├─ content-disposition@0.5.2
├─ content-type-parser@1.0.1
├─ content-type@1.0.2
├─ convert-source-map@1.5.0
├─ cookie-signature@1.0.6
├─ cookie@0.3.1
├─ core-js@2.4.1
├─ core-util-is@1.0.2
├─ cosmiconfig@2.1.3
├─ cross-spawn@4.0.2
├─ cryptiles@2.0.5
├─ crypto-browserify@3.3.0
├─ css-color-names@0.0.4
├─ css-loader@0.26.1
├─ css-select@1.2.0
├─ css-selector-tokenizer@0.6.0
├─ css-what@2.1.0
├─ cssesc@0.1.0
├─ cssnano@3.10.0
├─ csso@2.3.2
├─ cssom@0.3.2
├─ cssstyle@0.2.37
├─ d@1.0.0
├─ damerau-levenshtein@1.0.4
├─ dashdash@1.14.1
├─ date-now@0.1.4
├─ debug@2.6.6
├─ decamelize@1.2.0
├─ deep-extend@0.4.2
├─ deep-is@0.1.3
├─ default-require-extensions@1.0.0
├─ defined@1.0.0
├─ del@2.2.2
├─ delayed-stream@1.0.0
├─ delegates@1.0.0
├─ depd@1.1.0
├─ destroy@1.0.4
├─ detect-indent@4.0.0
├─ detect-port@1.1.0
├─ diff@3.2.0
├─ doctrine@1.5.0
├─ dom-converter@0.1.4
├─ dom-serializer@0.1.0
├─ domain-browser@1.1.7
├─ domelementtype@1.3.0
├─ domhandler@2.1.0
├─ domutils@1.1.6
├─ dotenv@2.0.0
├─ duplexer@0.1.1
├─ ecc-jsbn@0.1.1
├─ ee-first@1.1.1
├─ electron-to-chromium@1.3.10
├─ emoji-regex@6.4.2
├─ emojis-list@2.1.0
├─ encodeurl@1.0.1
├─ encoding@0.1.12
├─ enhanced-resolve@0.9.1
├─ entities@1.1.1
├─ errno@0.1.4
├─ error-ex@1.3.1
├─ es5-ext@0.10.16
├─ es6-iterator@2.0.1
├─ es6-map@0.1.5
├─ es6-set@0.1.5
├─ es6-symbol@3.1.1
├─ es6-weak-map@2.0.2
├─ escape-html@1.0.3
├─ escape-string-regexp@1.0.5
├─ escodegen@1.8.1
├─ escope@3.6.0
├─ eslint-config-react-app@0.6.2
├─ eslint-import-resolver-node@0.2.3
├─ eslint-loader@1.6.0
├─ eslint-module-utils@1.0.0
├─ eslint-plugin-flowtype@2.21.0
├─ eslint-plugin-import@2.0.1
├─ eslint-plugin-jsx-a11y@4.0.0
├─ eslint-plugin-react@6.4.1
├─ eslint@3.16.1
├─ espree@3.4.3
├─ esprima@2.7.3
├─ esrecurse@4.1.0
├─ estraverse@4.2.0
├─ esutils@2.0.2
├─ etag@1.8.0
├─ event-emitter@0.3.5
├─ eventemitter3@1.2.0
├─ events@1.1.1
├─ eventsource@0.1.6
├─ exec-sh@0.2.0
├─ exit-hook@1.1.1
├─ expand-brackets@0.1.5
├─ expand-range@1.8.2
├─ express@4.15.2
├─ extend@3.0.1
├─ extglob@0.3.2
├─ extract-text-webpack-plugin@1.0.1
├─ extsprintf@1.0.2
├─ fast-levenshtein@2.0.6
├─ fastparse@1.1.1
├─ faye-websocket@0.10.0
├─ fb-watchman@1.9.2
├─ fbjs@0.8.12
├─ figures@1.7.0
├─ file-entry-cache@2.0.0
├─ file-loader@0.10.0
├─ filename-regex@2.0.1
├─ fileset@2.0.3
├─ filesize@3.3.0
├─ fill-range@2.2.3
├─ finalhandler@1.0.2
├─ find-cache-dir@0.1.1
├─ find-up@1.1.2
├─ flat-cache@1.2.2
├─ flatten@1.0.2
├─ for-in@1.0.2
├─ for-own@0.1.5
├─ forever-agent@0.6.1
├─ form-data@2.1.4
├─ forwarded@0.1.0
├─ fresh@0.5.0
├─ fs-extra@0.30.0
├─ fs.realpath@1.0.0
├─ fsevents@1.0.17
├─ fstream-ignore@1.0.5
├─ fstream@1.0.11
├─ function-bind@1.1.0
├─ gauge@2.7.4
├─ generate-function@2.0.0
├─ generate-object-property@1.2.0
├─ get-caller-file@1.0.2
├─ getpass@0.1.7
├─ glob-base@0.3.0
├─ glob-parent@2.0.0
├─ glob@7.1.1
├─ globals@9.17.0
├─ globby@5.0.0
├─ graceful-fs@4.1.11
├─ graceful-readlink@1.0.1
├─ growly@1.3.0
├─ gzip-size@3.0.0
├─ handlebars@4.0.8
├─ har-schema@1.0.5
├─ har-validator@4.2.1
├─ has-ansi@2.0.0
├─ has-flag@1.0.0
├─ has-unicode@2.0.1
├─ has@1.0.1
├─ hawk@3.1.3
├─ he@1.1.1
├─ hoek@2.16.3
├─ home-or-tmp@2.0.0
├─ hosted-git-info@2.4.2
├─ html-comment-regex@1.1.1
├─ html-encoding-sniffer@1.0.1
├─ html-entities@1.2.0
├─ html-minifier@3.4.4
├─ html-webpack-plugin@2.24.0
├─ htmlparser2@3.3.0
├─ http-errors@1.5.1
├─ http-proxy-middleware@0.17.3
├─ http-proxy@1.16.2
├─ http-signature@1.1.1
├─ https-browserify@0.0.1
├─ iconv-lite@0.4.17
├─ icss-replace-symbols@1.0.2
├─ ieee754@1.1.8
├─ ignore@3.3.0
├─ imurmurhash@0.1.4
├─ indexes-of@1.0.1
├─ indexof@0.0.1
├─ inflight@1.0.6
├─ inherits@2.0.3
├─ ini@1.3.4
├─ inquirer@0.12.0
├─ interpret@0.6.6
├─ invariant@2.2.2
├─ invert-kv@1.0.0
├─ ipaddr.js@1.3.0
├─ is-absolute-url@2.1.0
├─ is-arrayish@0.2.1
├─ is-binary-path@1.0.1
├─ is-buffer@1.1.5
├─ is-builtin-module@1.0.0
├─ is-ci@1.0.10
├─ is-directory@0.3.1
├─ is-dotfile@1.0.2
├─ is-equal-shallow@0.1.3
├─ is-extendable@0.1.1
├─ is-extglob@1.0.0
├─ is-finite@1.0.2
├─ is-fullwidth-code-point@1.0.0
├─ is-glob@2.0.1
├─ is-my-json-valid@2.16.0
├─ is-number@2.1.0
├─ is-path-cwd@1.0.0
├─ is-path-in-cwd@1.0.0
├─ is-path-inside@1.0.0
├─ is-plain-obj@1.1.0
├─ is-posix-bracket@0.1.1
├─ is-primitive@2.0.0
├─ is-property@1.0.2
├─ is-resolvable@1.0.0
├─ is-stream@1.1.0
├─ is-svg@2.1.0
├─ is-typedarray@1.0.0
├─ is-utf8@0.2.1
├─ isarray@1.0.0
├─ isexe@2.0.0
├─ isobject@2.1.0
├─ isomorphic-fetch@2.2.1
├─ isstream@0.1.2
├─ istanbul-api@1.1.8
├─ istanbul-lib-coverage@1.1.0
├─ istanbul-lib-hook@1.0.6
├─ istanbul-lib-instrument@1.7.1
├─ istanbul-lib-report@1.1.0
├─ istanbul-lib-source-maps@1.2.0
├─ istanbul-reports@1.1.0
├─ jest-changed-files@17.0.2
├─ jest-cli@18.1.0
├─ jest-config@18.1.0
├─ jest-diff@18.1.0
├─ jest-environment-jsdom@18.1.0
├─ jest-environment-node@18.1.0
├─ jest-file-exists@17.0.0
├─ jest-haste-map@18.1.0
├─ jest-jasmine2@18.1.0
├─ jest-matcher-utils@18.1.0
├─ jest-matchers@18.1.0
├─ jest-mock@18.0.0
├─ jest-resolve-dependencies@18.1.0
├─ jest-resolve@18.1.0
├─ jest-runtime@18.1.0
├─ jest-snapshot@18.1.0
├─ jest-util@18.1.0
├─ jest@18.1.0
├─ jodid25519@1.0.2
├─ js-base64@2.1.9
├─ js-tokens@3.0.1
├─ js-yaml@3.8.4
├─ jsbn@0.1.1
├─ jsdom@9.12.0
├─ jsesc@1.3.0
├─ json-loader@0.5.4
├─ json-schema@0.2.3
├─ json-stable-stringify@1.0.1
├─ json-stringify-safe@5.0.1
├─ json3@3.3.2
├─ json5@0.5.1
├─ jsonfile@2.4.0
├─ jsonify@0.0.0
├─ jsonpointer@4.0.1
├─ jsprim@1.4.0
├─ jsx-ast-utils@1.4.1
├─ kind-of@3.2.0
├─ klaw@1.3.1
├─ lazy-cache@1.0.4
├─ lcid@1.0.0
├─ levn@0.3.0
├─ load-json-file@1.1.0
├─ loader-utils@0.2.17
├─ lodash._arraycopy@3.0.0
├─ lodash._arrayeach@3.0.0
├─ lodash._baseassign@3.2.0
├─ lodash._baseclone@3.3.0
├─ lodash._basecopy@3.0.1
├─ lodash._basefor@3.0.3
├─ lodash._bindcallback@3.0.1
├─ lodash._getnative@3.9.1
├─ lodash.assign@4.2.0
├─ lodash.camelcase@4.3.0
├─ lodash.clonedeep@3.0.2
├─ lodash.cond@4.5.2
├─ lodash.isarguments@3.1.0
├─ lodash.isarray@3.0.4
├─ lodash.keys@3.1.2
├─ lodash.memoize@4.1.2
├─ lodash.pickby@4.6.0
├─ lodash.uniq@4.5.0
├─ lodash@4.17.4
├─ longest@1.0.1
├─ loose-envify@1.3.1
├─ lower-case@1.1.4
├─ lru-cache@4.0.2
├─ macaddress@0.2.8
├─ makeerror@1.0.11
├─ marked-terminal@1.7.0
├─ marked@0.3.6
├─ math-expression-evaluator@1.2.17
├─ media-typer@0.3.0
├─ memory-fs@0.3.0
├─ merge-descriptors@1.0.1
├─ merge@1.2.0
├─ methods@1.1.2
├─ micromatch@2.3.11
├─ mime-db@1.27.0
├─ mime-types@2.1.15
├─ mime@1.2.11
├─ minimatch@3.0.4
├─ minimist@1.2.0
├─ mkdirp@0.5.1
├─ ms@0.7.2
├─ mute-stream@0.0.5
├─ nan@2.6.2
├─ natural-compare@1.4.0
├─ ncname@1.0.0
├─ negotiator@0.6.1
├─ no-case@2.3.1
├─ node-emoji@1.5.1
├─ node-fetch@1.6.3
├─ node-int64@0.4.0
├─ node-libs-browser@0.7.0
├─ node-notifier@4.6.1
├─ node-pre-gyp@0.6.34
├─ nopt@4.0.1
├─ normalize-package-data@2.3.8
├─ normalize-path@2.1.1
├─ normalize-range@0.1.2
├─ normalize-url@1.9.1
├─ npmlog@4.1.0
├─ nth-check@1.0.1
├─ num2fraction@1.2.2
├─ number-is-nan@1.0.1
├─ nwmatcher@1.3.9
├─ oauth-sign@0.8.2
├─ object-assign@4.1.1
├─ object.omit@2.0.1
├─ on-finished@2.3.0
├─ on-headers@1.0.1
├─ once@1.4.0
├─ onetime@1.1.0
├─ open@0.0.5
├─ opn@4.0.2
├─ optimist@0.6.1
├─ optionator@0.8.2
├─ original@1.0.0
├─ os-browserify@0.2.1
├─ os-homedir@1.0.2
├─ os-locale@1.4.0
├─ os-tmpdir@1.0.2
├─ osenv@0.1.4
├─ pako@0.2.9
├─ param-case@2.1.1
├─ parse-glob@3.0.4
├─ parse-json@2.2.0
├─ parse5@1.5.1
├─ parseurl@1.3.1
├─ path-browserify@0.0.0
├─ path-exists@2.1.0
├─ path-is-absolute@1.0.1
├─ path-is-inside@1.0.2
├─ path-parse@1.0.5
├─ path-to-regexp@0.1.7
├─ path-type@1.1.0
├─ pbkdf2-compat@2.0.1
├─ performance-now@0.2.0
├─ pify@2.3.0
├─ pinkie-promise@2.0.1
├─ pinkie@2.0.4
├─ pkg-dir@1.0.0
├─ pkg-up@1.0.0
├─ pluralize@1.2.1
├─ postcss-calc@5.3.1
├─ postcss-colormin@2.2.2
├─ postcss-convert-values@2.6.1
├─ postcss-discard-comments@2.0.4
├─ postcss-discard-duplicates@2.1.0
├─ postcss-discard-empty@2.1.0
├─ postcss-discard-overridden@0.1.1
├─ postcss-discard-unused@2.2.3
├─ postcss-filter-plugins@2.0.2
├─ postcss-load-config@1.2.0
├─ postcss-load-options@1.2.0
├─ postcss-load-plugins@2.3.0
├─ postcss-loader@1.2.2
├─ postcss-merge-idents@2.1.7
├─ postcss-merge-longhand@2.0.2
├─ postcss-merge-rules@2.1.2
├─ postcss-message-helpers@2.0.0
├─ postcss-minify-font-values@1.0.5
├─ postcss-minify-gradients@1.0.5
├─ postcss-minify-params@1.2.2
├─ postcss-minify-selectors@2.1.1
├─ postcss-modules-extract-imports@1.0.1
├─ postcss-modules-local-by-default@1.1.1
├─ postcss-modules-scope@1.0.2
├─ postcss-modules-values@1.2.2
├─ postcss-normalize-charset@1.1.1
├─ postcss-normalize-url@3.0.8
├─ postcss-ordered-values@2.2.3
├─ postcss-reduce-idents@2.4.0
├─ postcss-reduce-initial@1.0.1
├─ postcss-reduce-transforms@1.0.4
├─ postcss-selector-parser@2.2.3
├─ postcss-svgo@2.1.6
├─ postcss-unique-selectors@2.0.2
├─ postcss-value-parser@3.3.0
├─ postcss-zindex@2.2.0
├─ postcss@5.2.17
├─ prelude-ls@1.1.2
├─ prepend-http@1.0.4
├─ preserve@0.2.0
├─ pretty-error@2.1.0
├─ pretty-format@18.1.0
├─ private@0.1.7
├─ process-nextick-args@1.0.7
├─ process@0.11.10
├─ progress@1.1.8
├─ promise@7.1.1
├─ prop-types@15.5.9
├─ proxy-addr@1.1.4
├─ prr@0.0.0
├─ pseudomap@1.0.2
├─ punycode@1.4.1
├─ q@1.5.0
├─ qs@6.4.0
├─ query-string@4.3.4
├─ querystring-es3@0.2.1
├─ querystring@0.2.0
├─ querystringify@1.0.0
├─ randomatic@1.1.6
├─ range-parser@1.2.0
├─ rc@1.2.1
├─ react-dev-utils@0.5.2
├─ react-dom@15.5.4
├─ react-scripts@0.9.5
├─ react@15.5.4
├─ read-pkg-up@1.0.1
├─ read-pkg@1.1.0
├─ readable-stream@2.2.9
├─ readdirp@2.1.0
├─ readline2@1.0.1
├─ rechoir@0.6.2
├─ recursive-readdir@2.1.1
├─ redeyed@1.0.1
├─ reduce-css-calc@1.3.0
├─ reduce-function-call@1.0.2
├─ regenerate@1.3.2
├─ regenerator-runtime@0.10.5
├─ regenerator-transform@0.9.8
├─ regex-cache@0.4.3
├─ regexpu-core@1.0.0
├─ regjsgen@0.2.0
├─ regjsparser@0.1.5
├─ relateurl@0.2.7
├─ remove-trailing-separator@1.0.1
├─ renderkid@2.0.1
├─ repeat-element@1.1.2
├─ repeat-string@1.6.1
├─ repeating@2.0.1
├─ request@2.81.0
├─ require-directory@2.1.1
├─ require-from-string@1.2.1
├─ require-main-filename@1.0.1
├─ require-uncached@1.0.3
├─ requires-port@1.0.0
├─ resolve-from@1.0.1
├─ resolve@1.3.3
├─ restore-cursor@1.0.1
├─ right-align@0.1.3
├─ rimraf@2.6.1
├─ ripemd160@0.2.0
├─ run-async@0.1.0
├─ rx-lite@3.1.2
├─ safe-buffer@5.0.1
├─ sane@1.4.1
├─ sax@1.2.2
├─ semver@5.3.0
├─ send@0.15.1
├─ serve-index@1.8.0
├─ serve-static@1.12.1
├─ set-blocking@2.0.0
├─ set-immediate-shim@1.0.1
├─ setimmediate@1.0.5
├─ setprototypeof@1.0.3
├─ sha.js@2.2.6
├─ shelljs@0.7.7
├─ shellwords@0.1.0
├─ signal-exit@3.0.2
├─ slash@1.0.0
├─ slice-ansi@0.0.4
├─ sntp@1.0.9
├─ sockjs-client@1.0.1
├─ sockjs@0.3.18
├─ sort-keys@1.1.2
├─ source-list-map@0.1.8
├─ source-map-support@0.4.15
├─ source-map@0.5.6
├─ spdx-correct@1.0.2
├─ spdx-expression-parse@1.0.4
├─ spdx-license-ids@1.2.2
├─ sprintf-js@1.0.3
├─ sshpk@1.13.0
├─ statuses@1.3.1
├─ stream-browserify@2.0.1
├─ stream-cache@0.0.2
├─ stream-http@2.7.1
├─ strict-uri-encode@1.1.0
├─ string_decoder@0.10.31
├─ string-width@1.0.2
├─ string.prototype.codepointat@0.2.0
├─ stringstream@0.0.5
├─ strip-ansi@3.0.1
├─ strip-bom@2.0.0
├─ strip-json-comments@2.0.1
├─ style-loader@0.13.1
├─ supports-color@3.2.3
├─ svgo@0.7.2
├─ symbol-tree@3.2.2
├─ table@3.8.3
├─ tapable@0.1.10
├─ tar-pack@3.4.0
├─ tar@2.2.1
├─ test-exclude@3.3.0
├─ text-table@0.2.0
├─ throat@3.0.0
├─ through@2.3.8
├─ timers-browserify@2.0.2
├─ tmpl@1.0.4
├─ to-arraybuffer@1.0.1
├─ to-fast-properties@1.0.3
├─ toposort@1.0.3
├─ tough-cookie@2.3.2
├─ tr46@0.0.3
├─ trim-right@1.0.1
├─ tryit@1.0.3
├─ tty-browserify@0.0.0
├─ tunnel-agent@0.6.0
├─ tweetnacl@0.14.5
├─ type-check@0.3.2
├─ type-is@1.6.15
├─ typedarray@0.0.6
├─ ua-parser-js@0.7.12
├─ uglify-js@2.8.23
├─ uglify-to-browserify@1.0.2
├─ uid-number@0.0.6
├─ uniq@1.0.1
├─ uniqid@4.1.1
├─ uniqs@2.0.0
├─ unpipe@1.0.0
├─ upper-case@1.1.3
├─ url-loader@0.5.7
├─ url-parse@1.1.9
├─ url@0.11.0
├─ user-home@2.0.0
├─ util-deprecate@1.0.2
├─ util@0.10.3
├─ utila@0.3.3
├─ utils-merge@1.0.0
├─ uuid@2.0.3
├─ validate-npm-package-license@3.0.1
├─ vary@1.1.1
├─ vendors@1.0.1
├─ verror@1.3.6
├─ vm-browserify@0.0.4
├─ walker@1.0.7
├─ watch@0.10.0
├─ watchpack@0.2.9
├─ webidl-conversions@4.0.1
├─ webpack-core@0.6.9
├─ webpack-dev-middleware@1.10.2
├─ webpack-dev-server@1.16.2
├─ webpack-manifest-plugin@1.1.0
├─ webpack-sources@0.1.5
├─ webpack@1.14.0
├─ websocket-driver@0.6.5
├─ websocket-extensions@0.1.1
├─ whatwg-encoding@1.0.1
├─ whatwg-fetch@2.0.2
├─ whatwg-url@4.8.0
├─ whet.extend@0.9.9
├─ which-module@1.0.0
├─ which@1.2.14
├─ wide-align@1.1.2
├─ window-size@0.1.0
├─ wordwrap@0.0.2
├─ worker-farm@1.3.1
├─ wrap-ansi@2.1.0
├─ wrappy@1.0.2
├─ write@0.2.1
├─ xml-char-classes@1.0.0
├─ xml-name-validator@2.0.1
├─ xtend@4.0.1
├─ y18n@3.2.1
├─ yallist@2.1.2
├─ yargs-parser@4.2.1
└─ yargs@3.10.0
✨  Done in 25.72s.

Success! Created yarn-bug at /Users/tomc/yarn-bug
Inside that directory, you can run several commands:

  yarn start
    Starts the development server.

  yarn run build
    Bundles the app into static files for production.

  yarn test
    Starts the test runner.

  yarn run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd yarn-bug
  yarn start

Happy hacking!

tomc in tomc/  
› cd yarn-bug

tomc in yarn-bug/  
› yarn build
yarn build v0.23.4
$ react-scripts build 
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  46.82 KB  build/static/js/main.7dbe0fa8.js
  289 B     build/static/css/main.9a0fe4f1.css

The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage": "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

✨  Done in 5.92s.

tomc in yarn-bug/  
› yarn add react-svg-loader svg-react-loader
yarn add v0.23.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 42 new dependencies.
├─ babel-code-frame@6.22.0
├─ babel-generator@6.24.1
├─ babel-helpers@6.24.1
├─ babel-messages@6.23.0
├─ babel-plugin-transform-es2015-block-scoping@6.24.1
├─ babel-plugin-transform-es2015-classes@6.24.1
├─ babel-plugin-transform-es2015-destructuring@6.23.0
├─ babel-plugin-transform-es2015-function-name@6.24.1
├─ babel-plugin-transform-es2015-parameters@6.24.1
├─ babel-plugin-transform-flow-strip-types@6.22.0
├─ babel-plugin-transform-react-display-name@6.23.0
├─ babel-plugin-transform-react-jsx-self@6.22.0
├─ babel-plugin-transform-react-jsx-source@6.22.0
├─ babel-plugin-transform-react-jsx@6.22.0
├─ babel-plugin-transform-regenerator@6.22.0
├─ babel-preset-es2015-loose@7.0.0
├─ babel-preset-es2015@6.13.2
├─ babel-preset-react@6.11.1
├─ babel-register@6.24.1
├─ babel-runtime@6.23.0
├─ babel-template@6.24.1
├─ babel-traverse@6.24.1
├─ babel-types@6.24.1
├─ babylon@6.17.1
├─ csso@2.0.0
├─ loader-utils@0.2.17
├─ lodash.assign@4.2.0
├─ lodash.isplainobject@4.0.6
├─ lodash@4.17.4
├─ modify-babel-preset@1.2.0
├─ path-exists@1.0.0
├─ react-dom@15.5.4
├─ react-svg-loader@1.1.1
├─ react@15.5.4
├─ require-relative@0.8.7
├─ sax@1.2.2
├─ shebang-regex@1.0.0
├─ svg-react-loader@0.3.7
├─ svgo@0.6.6
├─ xml2js@0.4.17
├─ xmlbuilder@4.2.1
└─ yargs-parser@2.4.1
✨  Done in 4.63s.

tomc in yarn-bug/  
› yarn build
yarn build v0.23.4
$ react-scripts build 
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  46.82 KB  build/static/js/main.7dbe0fa8.js
  289 B     build/static/css/main.9a0fe4f1.css

The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage": "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

✨  Done in 5.96s.

tomc in yarn-bug/  
› rm -rf node_modules

tomc in yarn-bug/  
› yarn
yarn install v0.23.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 8.96s.

tomc in yarn-bug/  
› yarn build
yarn build v0.23.4
$ react-scripts build 
Creating an optimized production build...
Failed to compile.

Module build failed: Error: Options {"targets":{"ie":9,"uglify":true},"useBuiltIns":false} passed to /Users/tomc/yarn-bug/node_modules/babel-preset-env/lib/index.js which does not accept options.
    at /Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:333:15
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:305:20)
    at OptionManager.mergePresets (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:288:10)
    at OptionManager.mergeOptions (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:14)
    at /Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:289:14
    at /Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:342:20
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:305:20)
    at OptionManager.mergePresets (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:288:10)
    at OptionManager.mergeOptions (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:14)
    at OptionManager.init (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:383:12)
    at File.initOptions (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:223:65)
    at new File (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:140:24)
    at Pipeline.transform (/Users/tomc/yarn-bug/node_modules/babel-loader/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/tomc/yarn-bug/node_modules/babel-loader/lib/index.js:38:20)

error Command failed with exit code 1.

tomc in yarn-bug/  

@bestander
Copy link
Member

I think I know the reason.
There is a step during resolution in install command when Yarn merges semver compatible dependencies and installs the highest compatible one.
This step is not run during add command for some reason, which is a bug.

The error you see is probably caused by a breaking change in a library (babel-loader?).
PR and help in debugging would be welcome

@roman-holovin
Copy link

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 git@github.com:dantix/waterly.git
cd waterly
git checkout eslint-airbnb
yarn
yarn lint # there should be a lot of errors
yarn add eslint@3.15.0
yarn add eslint@3.19.0
yarn lint # there should be a handful of warnings

@bestander
Copy link
Member

bestander commented May 14, 2017 via email

@voxsim
Copy link
Contributor

voxsim commented May 18, 2017

@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 yarn add <mypackage> we push errounously <mypackage> instead we should push <mypackage>@<version> like we do in the install command. I tried to fix, but it doesn't work as expected O.o I prefer to share the information, so maybe you can fix it better.

@bestander
Copy link
Member

Thanks.
The trick is that Yarn replaces with maypackage@version here https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/add.js#L90 at resolution step.

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.
Would be good to debug and see why it fails for add command.

@blexrob
Copy link
Contributor

blexrob commented May 22, 2017

When running yarn check after the yarn command from the repro steps, I immediately got some errors. This was caused by the package resolver resolving patterns to different versions based on the order of package version resolve answers. I have filed issue #3466 for that.

@arcanis
Copy link
Member

arcanis commented Jun 29, 2017

Should be fixed in 0.27.2 👍

@arcanis arcanis closed this as completed Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants