Skip to content
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

[Question] How to avoid prepare script "Husky install" step when installing a npm package? #1146

Closed
luisxiaomai opened this issue May 11, 2022 · 3 comments · Fixed by morpho-org/morpho-blue#575 or morpho-org/morpho-blue-bundlers#356

Comments

@luisxiaomai
Copy link

I developed a npm package with prepare script "Husky Install". When someone install this package , it will pop up husky: command not found error.

I know it can be bypassed with adding "--ignore-script" when do install action, but is there another approach to disable prepare script when install this npm package?

Thank you.

@luisxiaomai luisxiaomai changed the title [Question] How to avoid "Husky install, command not found" when I in [Question] How to avoid prepare script "Husky install" step when installing a npm package? May 11, 2022
@typicode
Copy link
Owner

Hi,

I suppose you're installing with npm install --production?

You can find different ways to disable prepare or handle missing devDependencies here:
https://typicode.github.io/husky/#/?id=disable-husky-in-cidockerprod

That said, if the package is published to npmjs.com and someone installs it using npm install, prepare script won't run so it shouldn't be an issue.

@luisxiaomai
Copy link
Author

@typicode thanks

@Andarist
Copy link

@typicode prepare might get run when installing git dependencies though (mentioned in the npm's docs: https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants