-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] npx fails with "could not find executable" when running husky in v7 #1845
Comments
This might be related to #1834 |
@rafgraph On windows, I had no issues for hooks to be installed with Husky. When I used WSL on Ubuntu though, I had to use |
@csvn can you try installing the latest beta & seeing if you can repro? |
Hi @darcyclarke. Attached the output for the
I ran this within a Docker Devcontainer and WSL in VSCode. Environment info:
|
This is the same for Windows, npm
|
the issue here is that what you'll want to do to run the npx -p husky husky-run which informs |
I get this same error 2020-10-02T00_36_01_041Z-debug.log
|
@nlf running So in my mind, there are two options:
I just wanted clarity which option is the right one, before opening an issue on Husky with this. |
To add another data point, I think I'm running into the same issue with the
Based on nlf's comment there is a workaround until this is fixed in npm@7:
|
we published v7.0.0-rc.4 today that restores the old behavior of you can update with |
Thanks @nlf! I can verify that my Husky hooks now works again, same as with npm v6. |
Hi @nlf i still got error using |
please open a new issue and be sure to fill out the template and i'll see if i can help figure out what's going on |
Can confirm behaviour is working in |
I got this issue with |
I ran into the same bug after upgrading husky from version 4 to 5. Installing new version of package wasn't enough. The solution to fix this issue was to migrate husky to newer version. |
Thanks @piotros. I just follow the instructions here and fix it on my end as well: |
Hi there, I hope I'm not making a mistake by posting here but the quoted answer is for me the closest to a solution. I'm pretty sure you got that right because if I check the log it said "http fetch GET 304 https://registry.npmjs.org/husky-run 201ms" so I reckon it is looking for a package instead of running the script. But I'm using Nuxt and I'm not sure how I can fix this as the solution offered is for the npm cli. If anyone has an idea it will be really appreciated. Thanks! EDIT : after more research, I found this StackOverFlow thread : https://stackoverflow.com/questions/66246587/how-to-fix-error-not-found-husky-run-when-committing-new-code
Seems to work OK now. 👍 |
This was my issue! I had recently moved to a new machine and had forgotten to re-install |
#while create new react app i am fcaing this issue i have tried all command given above. ----->npx install create-react-app zoho after given above cmd . i am facing below error npm ERR! could not determine executable to run npm ERR! A complete log of this run can be found in: |
I used npx tsc --init. Worked for me. Im on a linux machine, if that fact matters. I also have typescript installed globally with npm. |
This is NOT a good way to fix it. In fact you will completely remove all git hooks you have setup, so naturally there will be nothing to run and thus it will produce no error. |
Doesn't that indicate the problem is the hooks themselves, and not npm? |
Add ( Note: this is done automatically for you when using the migration script here : https://github.com/typicode/husky-4-to-7 ) |
npm i yarn |
not working |
Due to incompatibility with more modern node versions, Husky thad to be upgraded according to these: https://github.com/npm/cli/issues/1845\#issuecomment-785037471 https://github.com/typicode/husky-4-to-8
The latest version of
husky
is broken in npm v7. I'm not sure if this regression is intended or not, i.e. if Husky needs to be updated or npm needs a bugfix.Current Behavior:
Expected Behavior:
Steps To Reproduce:
npm init -y
inside ithusky
withnpm i -D husky
echo '{ "hooks": { "pre-commit": "echo Hello World!" } }' > .huskyrc.json
npx husky-run pre-commit
Environment:
The text was updated successfully, but these errors were encountered: