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
Failure of install of packages when using git dependency with husky as prepare script #1213
Comments
Hi! I encountered this too, I'm using it everywhere:
I wonder if it's relevant as the standard for Another idea:
The first option is good to me for cases when on CI I don't mind if it will fail and don't install the hooks Of course, the new |
These solutions are fine, but not smart enough. We just only want to don't crash when used as git dependency, when your first one will just swallow all errors, and second one will do an extra global install of |
Also having this issue with version 8.0.2
|
@piranna Would you be able to provide a quick reproduction? I wasn't able to reproduce it on the rapid... @famu1hundred Sounds like a different issue or is this about a git dependency, too? |
Since they were git dependencies that didn't changed too much, I've just published them as private packages of GPR, and problem dissapeared, so it would be a bit difficult to create a new reproduction of the issue. |
I see! Actually, I rather thought of some quick steps / commands to reproduce this. Here is what I did (as mentioned above the problem didn't arise): echo "Node: $(node -v) | npm: $(npm -v)"
# Some git repo with husky
git clone git@github.com:open-cli-tools/concurrently.git
mkdir test && cd test
npm init
npm install ../concurrently Node: v18.12.1 | npm: 9.2.0 Edit: Okay, while writing this I've just realized that you probably meant a git dependency without being a git repo anymore... # Download zip of a git repo with husky
wget https://github.com/open-cli-tools/concurrently/archive/refs/heads/main.zip
unzip main.zip && rm main.zip && mv concurrently-main concurrently
mkdir test && cd test
npm init
npm install ../concurrently However in my case I'm getting this (probably because npm installs dependencies in npm ERR! code 127
npm ERR! path /Users/<...>/concurrently
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! sh: husky: command not found |
I'm installing a project from a git repo that I've downloaded locally. This project has a git dependency that itself is running
husky install
as aprepare
script, as documentation recommends. This execution fails with errorhusky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
. I think it should not be executed at all, both by using a different script, or detect when it's not being run from a top level package.The text was updated successfully, but these errors were encountered: