Skip to content

Yarn V2 compatibility #1850

@such

Description

@such

Intended outcome:

apollo commands should work normally when using Yarn V2 with Plug'n'Play

Actual outcome:

It fails with the following:

(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
  root:
   '/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
  name: '@oclif/plugin-help' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
  root:
   '/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
  name: '@oclif/plugin-not-found' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
  root:
   '/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
  name: '@oclif/plugin-plugins' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
  root:
   '/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
  name: '@oclif/plugin-warn-if-update-available' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
Error: @oclif/parser tried to access @oclif/errors, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: @oclif/errors (via "@oclif/errors")
Required by: @oclif/parser@npm:3.8.4 (via /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/)
Require stack:
- /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/validate.js
- /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/index.js
- /app/.yarn/$$virtual/@oclif-command-virtual-818296db1a/0/cache/@oclif-command-npm-1.5.19-b10e786c92-2.zip/node_modules/@oclif/command/lib/flags.js
- /app/.yarn/$$virtual/@oclif-command-virtual-818296db1a/0/cache/@oclif-command-npm-1.5.19-b10e786c92-2.zip/node_modules/@oclif/command/lib/index.js
- /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo/bin/run
    at Object.makeError (/app/.pnp.js:34509:34)
    at resolveToUnqualified (/app/.pnp.js:41869:37)
    at resolveRequest (/app/.pnp.js:41959:27)
    at Object.resolveRequest.maybeLog [as resolveRequest] (/app/.pnp.js:42027:26)
    at Function.module_1.Module._resolveFilename (/app/.pnp.js:41222:34)
    at Function.module_1.Module._load (/app/.pnp.js:41107:40)
    at Object.<anonymous> (/app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/validate.js:3:18)

How to reproduce the issue:

Bootstrap any Yarn V2 project, add the apollo dependency and run any apollo command.

Versions

Tested with 2.21.2 and latest (2.25.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions