Skip to content
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

Issue with husky install in post install script #373

Open
cole-adams opened this issue Jul 18, 2023 · 4 comments
Open

Issue with husky install in post install script #373

cole-adams opened this issue Jul 18, 2023 · 4 comments

Comments

@cole-adams
Copy link

I'm attempting to upgrade to the latest version of this package, and I'm getting the following error:

npm ERR! code 127
npm ERR! path <project>/node_modules/add-asset-html-webpack-plugin
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! sh: husky: command not found

We don't use husky in our project. I notice the post install script for this package is husky install which I believe is no longer best practice for husky.

Is there any way to resolve this?

@cole-adams cole-adams changed the title Issue with package installation Issue with husky install in post install script Jul 18, 2023
@louishust
Copy link

louishust commented Oct 20, 2023

I encounter almost the same problem.

7692 timing command:install Completed in 40492ms
7693 verbose stack Error: command failed
7693 verbose stack     at ChildProcess.<anonymous> (/Users/loushuai/workspace/testing/metersphere/.node/node/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
7693 verbose stack     at ChildProcess.emit (node:events:514:28)
7693 verbose stack     at maybeClose (node:internal/child_process:1105:16)
7693 verbose stack     at Socket.<anonymous> (node:internal/child_process:457:11)
7693 verbose stack     at Socket.emit (node:events:514:28)
7693 verbose stack     at Pipe.<anonymous> (node:net:337:12)
7694 verbose pkgid add-asset-html-webpack-plugin@6.0.0
7695 verbose cwd /Users/loushuai/workspace/testing/metersphere/api-test/frontend
7696 verbose Darwin 23.0.0
7697 verbose node v20.8.1
7698 verbose npm  v10.1.0
7699 error code 1
7700 error path /Users/loushuai/workspace/testing/metersphere/api-test/frontend/node_modules/add-asset-html-webpack-plugin
7701 error command failed
7702 error command sh -c husky install
7703 error husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)
7704 verbose exit 1

then when executing npm install , i run git init in the node_modules/add-asset-html-webpack-plugin directory, then npm install success.

Then i remove the whole node_modules directory, and try again, it's supposed to be failed again, but amazing, it success, and i do not known why

@gerhat
Copy link

gerhat commented Oct 30, 2023

Same issue here. I had to downgrade to 3.2.2.

@cha0s
Copy link

cha0s commented Jan 31, 2024

Still happening! Can't even use patch-package. I tried.

This package is completely broken!

@cha0s
Copy link

cha0s commented Jan 31, 2024

For anyone totally lost, the only way to make this package work is to do e.g.

npm install --save-dev husky

in your project. Fortunately, it's a pretty small package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants