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

Invalid dependency in modern Yarn #834

Open
matejchalk opened this issue Oct 11, 2024 · 0 comments
Open

Invalid dependency in modern Yarn #834

matejchalk opened this issue Oct 11, 2024 · 0 comments
Labels
🐛 bug something isn't working 🧩 cli

Comments

@matejchalk
Copy link
Collaborator

What happened?

When running Code PushUp CLI in a Yarn 4 project, I get the following error:

node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
Error: @code-pushup/cli tried to access vscode-material-icons, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: vscode-material-icons (via "vscode-material-icons/package.json")
Required by: @code-pushup/cli@npm:0.51.0 (via /home/matejchalk/.yarn/berry/cache/@code-pushup-cli-npm-0.51.0-f7bc3b2931-10c0.zip/node_modules/@code-pushup/cli/index.js)

    at makeError (/home/matejchalk/Documents/yarn-modern-test/.pnp.cjs:6593:34)
    at resolveToUnqualified (/home/matejchalk/Documents/yarn-modern-test/.pnp.cjs:8231:21)
    at Object.resolveToUnqualified (/home/matejchalk/Documents/yarn-modern-test/.pnp.cjs:8411:26)
    at resolve$1 (file:///home/matejchalk/Documents/yarn-modern-test/.pnp.loader.mjs:2031:31)
    at nextResolve (node:internal/modules/esm/hooks:865:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:303:30)
    at handleMessage (node:internal/modules/esm/worker:196:24)
    at Immediate.checkForMessages (node:internal/modules/esm/worker:138:28)
    at process.processImmediate (node:internal/timers:478:21)

What would you expect to happen?

Internal dependencies of @code-pushup/cli should be properly defined for modern Yarn.

What steps did you take?

  1. Install Yarn 2+ if you haven't already (e.g. with corepack enable).
  2. Create a new folder and initialize a Yarn project with yarn init -2.
  3. Install CLI with yarn add -D @code-pushup/cli.
  4. Run CLI with yarn code-pushup.

Code PushUp package version

0.51.0

What operation system are you on?

Linux

Node version

20.11.0

Relevant log output

No response

@matejchalk matejchalk added 🐛 bug something isn't working 🧩 cli labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something isn't working 🧩 cli
Projects
None yet
Development

No branches or pull requests

1 participant