Open subyraman opened 7 years ago
I tried replicating this in yarn v0.28.4 and it's not fixed yet. But I don't really understand what is going on. Why does yarn try to find versions for @types/node
? It is not listed as a dependency of jsdom@11.0.0
@types/node
is a dependency of parse5
, which is listed in the dependencies there.
Maybe this is a bug with scoped packages?
I took a shot at this issue and described what I found in PR #4815
edit: I took another shot with the comments in the previous PR, and new changes are waiting to be reviewed in PR #4992
We had pretty severe problems with scoped packages and offline mode, particularly around @types modules, and found a simple fix that I made available at #4822. It might be orthogonal to the issue reported here, but it sounded similar enough that I thought it was worth mentioning (at least for future folks doing google searches trying to find their problem and who come across this bug report)
Still happens to me with 1.3.2 on ubuntu 16.04 with nodejs 9.3.0 and nodejs 7.7.4 and on ubuntu 17.10 with nodejs 9.3.0.
$ yarn add jest
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 359 new dependencies.
ββ @babel/code-frame@7.0.0-beta.36
ββ @types/node@8.5.2
ββ abab@1.0.4
ββ acorn-globals@4.1.0
ββ acorn@5.2.1
ββ ajv@5.5.2
ββ align-text@0.1.4
ββ amdefine@1.0.1
ββ ansi-escapes@3.0.0
ββ ansi-regex@2.1.1
ββ ansi-styles@3.2.0
ββ anymatch@1.3.2
ββ append-transform@0.4.0
ββ argparse@1.0.9
ββ arr-diff@2.0.0
ββ arr-flatten@1.1.0
ββ array-equal@1.0.0
ββ array-unique@0.2.1
ββ arrify@1.0.1
ββ asn1@0.2.3
ββ assert-plus@1.0.0
ββ astral-regex@1.0.0
ββ async@2.6.0
ββ asynckit@0.4.0
ββ aws-sign2@0.7.0
ββ aws4@1.6.0
ββ babel-code-frame@6.26.0
ββ babel-core@6.26.0
ββ babel-generator@6.26.0
ββ babel-helpers@6.24.1
ββ babel-jest@22.0.4
ββ babel-messages@6.23.0
ββ babel-plugin-istanbul@4.1.5
ββ babel-plugin-jest-hoist@22.0.3
ββ babel-plugin-syntax-object-rest-spread@6.13.0
ββ babel-preset-jest@22.0.3
ββ babel-register@6.26.0
ββ babel-runtime@6.26.0
ββ babel-template@6.26.0
ββ babel-traverse@6.26.0
ββ babel-types@6.26.0
ββ babylon@6.18.0
ββ balanced-match@1.0.0
ββ bcrypt-pbkdf@1.0.1
ββ bindings@1.3.0
ββ brace-expansion@1.1.8
ββ braces@1.8.5
ββ browser-process-hrtime@0.1.2
ββ browser-resolve@1.11.2
ββ bser@2.0.0
ββ builtin-modules@1.1.1
ββ callsites@2.0.0
ββ camelcase@4.1.0
ββ caseless@0.12.0
ββ center-align@0.1.3
ββ chalk@2.3.0
ββ ci-info@1.1.2
ββ cliui@3.2.0
ββ co@4.6.0
ββ code-point-at@1.1.0
ββ color-convert@1.9.1
ββ color-name@1.1.3
ββ combined-stream@1.0.5
ββ concat-map@0.0.1
ββ content-type-parser@1.0.2
ββ convert-source-map@1.5.1
ββ core-js@2.5.3
ββ core-util-is@1.0.2
ββ cross-spawn@5.1.0
ββ cssom@0.3.2
ββ cssstyle@0.2.37
ββ dashdash@1.14.1
ββ debug@2.6.9
ββ decamelize@1.2.0
ββ deep-is@0.1.3
ββ default-require-extensions@1.0.0
ββ define-properties@1.1.2
ββ delayed-stream@1.0.0
ββ detect-indent@4.0.0
ββ detect-newline@2.1.0
ββ diff@3.4.0
ββ domexception@1.0.0
ββ ecc-jsbn@0.1.1
ββ error-ex@1.3.1
ββ es-abstract@1.10.0
ββ es-to-primitive@1.1.1
ββ escape-string-regexp@1.0.5
ββ escodegen@1.9.0
ββ esprima@4.0.0
ββ estraverse@4.2.0
ββ esutils@2.0.2
ββ exec-sh@0.2.1
ββ execa@0.7.0
ββ expand-brackets@0.1.5
ββ expand-range@1.8.2
ββ expect@22.0.3
ββ extend@3.0.1
ββ extglob@0.3.2
ββ extsprintf@1.3.0
ββ fast-deep-equal@1.0.0
ββ fast-json-stable-stringify@2.0.0
ββ fast-levenshtein@2.0.6
ββ fb-watchman@2.0.0
ββ filename-regex@2.0.1
ββ fileset@2.0.3
ββ fill-range@2.2.3
ββ find-up@2.1.0
ββ for-in@1.0.2
ββ for-own@0.1.5
ββ foreach@2.0.5
ββ forever-agent@0.6.1
ββ form-data@2.3.1
ββ fs.realpath@1.0.0
ββ function-bind@1.1.1
ββ get-caller-file@1.0.2
ββ get-stream@3.0.0
ββ getpass@0.1.7
ββ glob-base@0.3.0
ββ glob-parent@2.0.0
ββ glob@7.1.2
ββ globals@9.18.0
ββ graceful-fs@4.1.11
ββ growly@1.3.0
ββ handlebars@4.0.11
ββ har-schema@2.0.0
ββ har-validator@5.0.3
ββ has-ansi@2.0.0
ββ has-flag@2.0.0
ββ has@1.0.1
ββ hoek@4.2.0
ββ home-or-tmp@2.0.0
ββ hosted-git-info@2.5.0
ββ html-encoding-sniffer@1.0.2
ββ http-signature@1.2.0
ββ iconv-lite@0.4.19
ββ imurmurhash@0.1.4
ββ inflight@1.0.6
ββ inherits@2.0.3
ββ invariant@2.2.2
ββ invert-kv@1.0.0
ββ is-arrayish@0.2.1
ββ is-buffer@1.1.6
ββ is-builtin-module@1.0.0
ββ is-callable@1.1.3
ββ is-ci@1.0.10
ββ is-date-object@1.0.1
ββ is-dotfile@1.0.3
ββ 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-number@2.1.0
ββ is-posix-bracket@0.1.1
ββ is-primitive@2.0.0
ββ is-regex@1.0.4
ββ is-stream@1.1.0
ββ is-symbol@1.0.1
ββ is-typedarray@1.0.0
ββ is-utf8@0.2.1
ββ isarray@1.0.0
ββ isexe@2.0.0
ββ isobject@2.1.0
ββ isstream@0.1.2
ββ istanbul-api@1.2.1
ββ istanbul-lib-coverage@1.1.1
ββ istanbul-lib-hook@1.1.0
ββ istanbul-lib-instrument@1.9.1
ββ istanbul-lib-report@1.1.2
ββ istanbul-lib-source-maps@1.2.2
ββ istanbul-reports@1.1.3
ββ jest-changed-files@22.0.3
ββ jest-cli@22.0.4
ββ jest-config@22.0.4
ββ jest-diff@22.0.3
ββ jest-docblock@22.0.3
ββ jest-environment-jsdom@22.0.4
ββ jest-environment-node@22.0.4
ββ jest-get-type@22.0.3
ββ jest-haste-map@22.0.3
ββ jest-jasmine2@22.0.4
ββ jest-leak-detector@22.0.3
ββ jest-matcher-utils@22.0.3
ββ jest-message-util@22.0.3
ββ jest-mock@22.0.3
ββ jest-regex-util@22.0.3
ββ jest-resolve-dependencies@22.0.3
ββ jest-resolve@22.0.4
ββ jest-runner@22.0.4
ββ jest-runtime@22.0.4
ββ jest-snapshot@22.0.3
ββ jest-util@22.0.4
ββ jest-validate@22.0.3
ββ jest-worker@22.0.3
ββ jest@22.0.4
ββ js-tokens@3.0.2
ββ js-yaml@3.10.0
ββ jsbn@0.1.1
ββ jsdom@11.5.1
ββ jsesc@1.3.0
ββ json-schema-traverse@0.3.1
ββ json-schema@0.2.3
ββ json-stable-stringify@1.0.1
ββ json-stringify-safe@5.0.1
ββ json5@0.5.1
ββ jsonify@0.0.0
ββ jsprim@1.4.1
ββ kind-of@3.2.2
ββ lazy-cache@1.0.4
ββ lcid@1.0.0
ββ left-pad@1.2.0
ββ leven@2.1.0
ββ levn@0.3.0
ββ load-json-file@1.1.0
ββ locate-path@2.0.0
ββ lodash.sortby@4.7.0
ββ lodash@4.17.4
ββ longest@1.0.1
ββ loose-envify@1.3.1
ββ lru-cache@4.1.1
ββ makeerror@1.0.11
ββ mem@1.1.0
ββ merge-stream@1.0.1
ββ merge@1.2.0
ββ micromatch@2.3.11
ββ mime-db@1.30.0
ββ mime-types@2.1.17
ββ mimic-fn@1.1.0
ββ minimatch@3.0.4
ββ minimist@1.2.0
ββ mkdirp@0.5.1
ββ ms@2.0.0
ββ nan@2.8.0
ββ natural-compare@1.4.0
ββ node-int64@0.4.0
ββ node-notifier@5.1.2
ββ normalize-package-data@2.4.0
ββ normalize-path@2.1.1
ββ npm-run-path@2.0.2
ββ number-is-nan@1.0.1
ββ nwmatcher@1.4.3
ββ oauth-sign@0.8.2
ββ object-assign@4.1.1
ββ object-keys@1.0.11
ββ object.getownpropertydescriptors@2.0.3
ββ object.omit@2.0.1
ββ once@1.4.0
ββ optimist@0.6.1
ββ optionator@0.8.2
ββ os-homedir@1.0.2
ββ os-locale@2.1.0
ββ os-tmpdir@1.0.2
ββ p-finally@1.0.0
ββ p-limit@1.1.0
ββ p-locate@2.0.0
ββ parse-glob@3.0.4
ββ parse-json@2.2.0
ββ parse5@3.0.3
ββ path-exists@3.0.0
ββ path-is-absolute@1.0.1
ββ path-key@2.0.1
ββ path-parse@1.0.5
ββ path-type@1.1.0
ββ performance-now@2.1.0
ββ pify@2.3.0
ββ pinkie-promise@2.0.1
ββ pinkie@2.0.4
ββ pn@1.0.0
ββ prelude-ls@1.1.2
ββ preserve@0.2.0
ββ pretty-format@22.0.3
ββ private@0.1.8
ββ process-nextick-args@1.0.7
ββ pseudomap@1.0.2
ββ punycode@1.4.1
ββ qs@6.5.1
ββ randomatic@1.1.7
ββ read-pkg-up@1.0.1
ββ read-pkg@1.1.0
ββ readable-stream@2.3.3
ββ realpath-native@1.0.0
ββ regenerator-runtime@0.11.1
ββ regex-cache@0.4.4
ββ remove-trailing-separator@1.1.0
ββ repeat-element@1.1.2
ββ repeat-string@1.6.1
ββ repeating@2.0.1
ββ request-promise-core@1.1.1
ββ request-promise-native@1.0.5
ββ request@2.83.0
ββ require-directory@2.1.1
ββ require-main-filename@1.0.1
ββ resolve@1.1.7
ββ right-align@0.1.3
ββ rimraf@2.6.2
ββ safe-buffer@5.1.1
ββ sane@2.2.0
ββ sax@1.2.4
ββ semver@5.4.1
ββ set-blocking@2.0.0
ββ shebang-command@1.2.0
ββ shebang-regex@1.0.0
ββ shellwords@0.1.1
ββ signal-exit@3.0.2
ββ slash@1.0.0
ββ source-map-support@0.5.0
ββ source-map@0.5.7
ββ 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.1
ββ stack-utils@1.0.1
ββ stealthy-require@1.1.1
ββ string_decoder@1.0.3
ββ string-length@2.0.0
ββ string-width@1.0.2
ββ stringstream@0.0.5
ββ strip-ansi@3.0.1
ββ strip-bom@2.0.0
ββ strip-eof@1.0.0
ββ supports-color@4.5.0
ββ symbol-tree@3.2.2
ββ test-exclude@4.1.1
ββ throat@4.1.0
ββ tmpl@1.0.4
ββ to-fast-properties@1.0.3
ββ tough-cookie@2.3.3
ββ tr46@1.0.1
ββ trim-right@1.0.1
ββ tunnel-agent@0.6.0
ββ tweetnacl@0.14.5
ββ type-check@0.3.2
ββ uglify-js@2.8.29
ββ uglify-to-browserify@1.0.2
ββ util-deprecate@1.0.2
ββ util.promisify@1.0.0
ββ uuid@3.1.0
ββ validate-npm-package-license@3.0.1
ββ verror@1.10.0
ββ walker@1.0.7
ββ watch@0.18.0
ββ weak@1.0.1
ββ webidl-conversions@4.0.2
ββ whatwg-encoding@1.0.3
ββ whatwg-url@6.4.0
ββ which-module@2.0.0
ββ which@1.3.0
ββ window-size@0.1.0
ββ wordwrap@0.0.3
ββ wrap-ansi@2.1.0
ββ wrappy@1.0.2
ββ write-file-atomic@2.3.0
ββ xml-name-validator@2.0.1
ββ y18n@3.2.1
ββ yallist@2.1.2
ββ yargs-parser@8.1.0
ββ yargs@10.0.3
Done in 7.48s.
$ rm -rf node_modules package.json yarn.lock
$ yarn add --offline jest
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find any versions for "@types/node" that matches "*" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Couldn't find any versions for "@babel/code-frame" that matches "^7.0.0-beta.35" in our cache (possible versions are ""). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.
at /usr/local/lib/node_modules/yarn/lib/cli.js:49034:15
at Generator.next (<anonymous>)
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:92:30)
at /usr/local/lib/node_modules/yarn/lib/cli.js:103:13
at <anonymous>
I definitely have those in the cache:
$ yarn cache list | grep -E '@types/node|@babel/code-frame'
@babel/code-frame 7.0.0-beta.35 npm https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.35.tgz#04eeb6dca7efef8f65776a4c214157303b85ad51
@babel/code-frame 7.0.0-beta.36 npm https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4
@types/node 8.5.2 npm https://registry.yarnpkg.com/@types/node/-/node-8.5.2.tgz#83b8103fa9a2c2e83d78f701a9aa7c9539739aa5
EDIT: added more outputs
Do you want to request a feature or report a bug? Bug. @BYK suggested I repost this as a new issue.
What is the current behavior? Offline installation of JSDOM fails on the dependency
@types/node
. This was noted in #825 but does not seem fully resolved.If the current behavior is a bug, please provide the steps to reproduce. The behavior occurs when the
@types/node
dependency hasn't been added to a lockfile; yarn searches through the cache and does not resolve the dependency properly.It is definitely available in my cache.
Same failure in the latest nightly:
What is the expected behavior?
I expect JSDOM to be installed offline. Other cached packages work fine with offline installation and are resolved from the cache:
Node: v6.7.0 Tested with Yarn 0.27.5 and nightly v1.0.0-20170825.1555 #