git-hooks icon indicating copy to clipboard operation
git-hooks copied to clipboard

hooks scripts stop working when `yarn` is update

Open nkzawa opened this issue 6 years ago • 3 comments

It looks yarn path is hardcoded so that when it's updated and removed by like brew, scripts stop working. I think it's the same for node which the path is hardcoded. Is there are an easy way to update the scripts?

nkzawa avatar Jun 28 '19 06:06 nkzawa

Not via a convenient command. I think you're good to remove everything under .git/hooks, clear your node modules and npm i again. Upon install, we evaluate where the package manager is telling us it lives. If that path changes, you'll have to uninstall and reinstall.

Might work by doing npm uninstall @zeit/git-hooks; npm install --save-dev @zeit-hooks again. I'm not sure if npm has a "re-install" command that does just this.

Qix- avatar Jun 28 '19 08:06 Qix-

👍 it seems npm uninstall @zeit/git-hooks; npm install --save-dev @zeit-hooks works. (tested with yarn).

I wonder if we can just use node and (npm or yarn) in path. so that you don't need to concern this problem.

nkzawa avatar Jun 29 '19 03:06 nkzawa