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

Yarn add husky failed due to node version is lower than 18, How can I skip installing in CI #1385

Open
1 task done
cai-zhuo opened this issue Feb 6, 2024 · 3 comments
Open
1 task done

Comments

@cai-zhuo
Copy link

cai-zhuo commented Feb 6, 2024

Troubleshoot

If you're migrating from husky 4, see:
https://typicode.github.io/husky/migrate-from-v4.html

Context
Please describe your issue and provide some context:

  • Terminal or GUI client (PowerShell, Git Bash, GitHub Desktop, ...)
  • If applicable, content of the failing hook
  • If possible, minimal steps to reproduce the issue

Thank you!

I wanna check my code with eslint + lint-staged, but my CI node image version is lower than 18, so should I find a way to avoid to install husky in CI ? Or just delete husky in package.json ?
Can I have better way than telling everyone to install husky in localhost to solve this ?
Thanks to what you have done in this repo


What I met :

error husky@9.0.10: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.19.0"

@cai-zhuo cai-zhuo changed the title Yarn add husky failed due to node version is less than 18, How can I skip installing in CI Yarn add husky failed due to node version is lower than 18, How can I skip installing in CI Feb 6, 2024
@typicode
Copy link
Owner

typicode commented Feb 6, 2024

You have some options here :)
https://typicode.github.io/husky/how-to.html#ci-server-and-docker

@cai-zhuo
Copy link
Author

cai-zhuo commented Feb 7, 2024

You have some options here :) https://typicode.github.io/husky/how-to.html#ci-server-and-docker

image

Thank you for answering, but I tried to set HUSKEY = 0, I still met this error
May be I get wrong "husky" version ?

@silentsakky
Copy link

silentsakky commented Mar 29, 2024

We are bypassing husky install in circleci using below code, thought it might help you as well
"prepare": "is-ci || husky install"
above script needs to be added in package.json
is-ci is very simple npm module https://www.npmjs.com/package/is-ci

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

No branches or pull requests

3 participants