Description
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.
sraman@sraman: bar$ yarn add jsdom@11.0.0 --offline
yarn add v0.27.5
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find any versions for "@types/node" that matches "^6.0.46" in our cache. Possible versions: ""
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
It is definitely available in my cache.
sraman@sraman: bar$ yarn cache ls | grep "@types"
@types/node 6.0.78 npm https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470
@types/node 6.0.87 npm https://registry.yarnpkg.com/@types/node/-/node-6.0.87.tgz#5ab5774f8351a33a935099fa6be850aa0b0ad564
@types/node 6.0.88 npm https://registry.yarnpkg.com/@types/node/-/node-6.0.88.tgz#f618f11a944f6a18d92b5c472028728a3e3d4b66
@types/node 8.0.25 npm https://registry.yarnpkg.com/@types/node/-/node-8.0.25.tgz#66ecaf4df93f5281b48427ee96fbcdfc4f0cdce1
Same failure in the latest nightly:
sraman@sraman: bin$ ./yarn add jsdom@11.0.0 --offline
yarn add v1.0.0-20170825.1555
warning package.json: No license field
warning No license field
[1/4] 🔍 Resolving packages...
error Couldn't find any versions for "@types/node" that matches "^6.0.46" 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.
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:
sraman@sraman: bin$ yarn add yargs@3.27.0 --offline
yarn add v0.27.5
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 18 new dependencies.
├─ align-text@0.1.4
├─ camelcase@1.2.1
├─ center-align@0.1.3
├─ cliui@2.1.0
├─ decamelize@1.2.0
├─ invert-kv@1.0.0
├─ is-buffer@1.1.5
├─ kind-of@3.2.2
├─ lazy-cache@1.0.4
├─ lcid@1.0.0
├─ longest@1.0.1
├─ os-locale@1.4.0
├─ repeat-string@1.6.1
├─ right-align@0.1.3
├─ window-size@0.1.4
├─ wordwrap@0.0.2
├─ y18n@3.2.1
└─ yargs@3.27.0
Done in 0.90s.
Node: v6.7.0 Tested with Yarn 0.27.5 and nightly v1.0.0-20170825.1555