You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now users that are installing my module are having the prepare script triggered, and thus husky trying to install. Which should not happen. It seems that the prepare lifecycle script doesn't distinguish between production and development installations. This makes the prepare lifecycle hook unusable for projects that have to be published as an npm module.
See this issue and the linked issues for context: RJWadley/stylelint-no-unsupported-browser-features#151. I'm still debugging so information is still coming in, but I thought I'd already report it as it could affect a lot of people if the above is correct.
I've reproduced this on node 16.2.0 with npm 7.13.0. To reproduce run:
# This version contains the prepare script and fails on installation as a dep
npm i --save-dev stylelint-no-unsupported-browser-features@5.0.0
# This version does not have the prepare script and installs fine
npm i --save-dev stylelint-no-unsupported-browser-features@5.0.1
It is unclear to me whether this behaviour of the prepare hook is intentional or not (see this issue: npm/cli#2152). However, what is clear is that at the moment this strategy does not seem to be compatible with projects like the above, as this hook should not be triggered for users that are installing the module as a dependency.
The text was updated successfully, but these errors were encountered:
Ah yes you're right, I missed that, the prepare script change wasn't part of the release. Ok that's great, then the prepare script is exactly what I need. Thanks!
I've just pushed a major update for https://github.com/ismay/stylelint-no-unsupported-browser-features to npm. For that module, part of the update was some housekeeping, like updating husky to latest and adding the recommended prepare script.
Now users that are installing my module are having the prepare script triggered, and thus husky trying to install. Which should not happen. It seems that the prepare lifecycle script doesn't distinguish between production and development installations. This makes the prepare lifecycle hook unusable for projects that have to be published as an npm module.
See this issue and the linked issues for context: RJWadley/stylelint-no-unsupported-browser-features#151. I'm still debugging so information is still coming in, but I thought I'd already report it as it could affect a lot of people if the above is correct.
I've reproduced this on node 16.2.0 with npm 7.13.0. To reproduce run:
It is unclear to me whether this behaviour of the
prepare
hook is intentional or not (see this issue: npm/cli#2152). However, what is clear is that at the moment this strategy does not seem to be compatible with projects like the above, as this hook should not be triggered for users that are installing the module as a dependency.The text was updated successfully, but these errors were encountered: