Skip to content

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/run-script@4.1.3":
    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