husky icon indicating copy to clipboard operation
husky copied to clipboard

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

Open cai-zhuo opened this issue 1 year ago • 3 comments

Troubleshoot

  • [x] Before creating an issue, please check: https://typicode.github.io/husky/troubleshoot.html

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 [email protected]: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.19.0"

cai-zhuo avatar Feb 06 '24 05:02 cai-zhuo

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

typicode avatar Feb 06 '24 09:02 typicode

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 ?

cai-zhuo avatar Feb 07 '24 03:02 cai-zhuo

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

silentsakky avatar Mar 29 '24 07:03 silentsakky