husky: Unable to make husky work with yarn pnp on windows
I set the HUSKY_USE_YARN
option but I’m still getting the following error on Windows 10 …
error Command “husky-run” not found.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- build: upgrade to Yarn 2 (berry) This upgrade is necessary to make Husky work w/ Yarn PnP. Cf [husky #553](https://github.com/typicode/husky/issues/553). — committed to HusamElbashir/vue-ish by HusamElbashir 5 years ago
- build: upgrade to Yarn 2 (berry) This upgrade is necessary to make Husky work w/ Yarn PnP. Cf https://github.com/typicode/husky/issues/553. — committed to HusamElbashir/vue-ish by HusamElbashir 5 years ago
- build: upgrade to Yarn 2 (berry) This upgrade is necessary to make Husky work w/ Yarn PnP. Cf https://github.com/typicode/husky/issues/553. — committed to HusamElbashir/vue-ish by HusamElbashir 5 years ago
Cf https://github.com/typicode/husky/issues/560#issuecomment-520827817 - tl;dr there’s a bug in Yarn 1 which is fixed in Yarn 2 (which is the generally recommended version to use when using PnP).
My bad. Was mistakenly using Yarn 1 in another repo when I tried this. I can confirm it works flawlessly with Yarn 2 👌
I’ve published a new version, which is a very early
v4.0.0
version. It should support Yarn PnP out of the box.You can give it a try using
yarn add husky@next --dev
.Feedback is welcome.
For a global cache, you’ll be looking for
enableGlobalCache
(it’s similar to setting a customcacheFolder
, except that you won’t have to remember which path it should be when configuring other projects).#562 was merged and husky
v4.0.0-beta.1
was publishedAnother approach is currently being taken (the one with
yarn husky-run
).