Skip to content

Add which to dependencies for yarn berry #88

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

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

jackw
Copy link
Contributor

@jackw jackw commented Jun 28, 2022

This PR adds which as a dependency of this project which should make yarn berry PnP projects happy.

When using this package in a yarn berry project, yarn berry complains about it trying to access which.

Error: @npmcli/run-script tried to access which, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: which
Required by: @npmcli/run-script@npm:4.1.3 (via /Users/jackwestbrook/Projects/grafana/.yarn/cache/@npmcli-run-script-npm-4.1.3-e85355f10b-62fb1a0e12.zip/node_modules/@npmcli/run-script/lib/)

Require stack:
- /Users/jackwestbrook/Projects/grafana/.yarn/cache/@npmcli-run-script-npm-4.1.3-e85355f10b-62fb1a0e12.zip/node_modules/@npmcli/run-script/lib/make-spawn-args.js

This results in needing to add the following to .yarnrc.yml in a yarn berry project:

packageExtensions:
  "@npmcli/[email protected]":
    dependencies:
      which: ^2.0.2

Looking at the code it appears make-spawn-args.js does indeed pull in the nested which dependency.

References

@jackw jackw requested a review from a team as a code owner June 28, 2022 08:27
@nlf
Copy link
Contributor

nlf commented Jun 28, 2022

ugh, yes i missed this. thank you!

@nlf nlf merged commit 0bc2eec into npm:main Jun 28, 2022
@jackw jackw deleted the jackw/add-which-dependency branch June 29, 2022 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants