package.json: Specify node-gyp as a dependency #159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because
node-gyp
is used as part of theinstall
lifecycle script,node-gyp
should be provided as a dependency, not as a devDependency.This should fix installs of this package in Yarn 2. No errors occur in Yarn 1 because Yarn 1 (and presumably also npm) attempt to add the globally installed
node-gyp
binary to $PATH before running the script: https://github.com/yarnpkg/yarn/blob/a3b1294c22043cd8868b6a1decb77b673e764efd/src/util/execute-lifecycle-script.js#L173However, this does not guarantee that the node-gyp that will be used to install this package will be the same version as the one specified in devDependencies, so this should also reconcile that behavior... I hope.
I tested this fix locally, and it seems to make Yarn 2 happy.
refs: