paixaop / node-sodium

Port of the lib sodium encryption library to Node.js
MIT License
351 stars 126 forks source link

package.json: Specify node-gyp as a dependency #159

Open SEAPUNK opened 4 years ago

SEAPUNK commented 4 years ago

Because node-gyp is used as part of the install 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#L173

However, 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: