Skip to content

No HUSKY_GIT_PARAMS not available #2339

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

Closed
Manubi opened this issue Dec 2, 2020 · 6 comments
Closed

No HUSKY_GIT_PARAMS not available #2339

Manubi opened this issue Dec 2, 2020 · 6 comments

Comments

@Manubi
Copy link
Contributor

Manubi commented Dec 2, 2020

Hello,

I am trying to make commitlint work with husky v5 but I am getting the following error:
Error:
Error: Recieved 'HUSKY_GIT_PARAMS' as value for -E | --env, but environment variable 'HUSKY_GIT_PARAMS' is not available globally

package.json
"@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0" "husky": "^5.0.4",

commit-msg_—_impfi-frontend

thanks for the help!

UPDATE:

Fixed it with this:
`# .husky/pre-commit

...

npx --no-install commitlint --edit $1

or

yarn commitlint --edit $1`

@escapedcat
Copy link
Member

Relates to #2340

@phortonssf
Copy link

Just went through this issue, you have husky v5 and need to follow the v5 conventions per the v5 docs.
https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v5

@escapedcat
Copy link
Member

Thanks to @macklinu this is also mentined now in the README.
@Manubi wanna close this?

@akshayrohatgi94
Copy link

akshayrohatgi94 commented Mar 25, 2022

Exact sollution https://typicode.github.io/husky/#/?id=husky_git_params-ie-commitlint-

@escapedcat
Copy link
Member

@akshayrohatgi94 thanks for letting us know! Funny they added this example.
Wanna create a PR to add this to the README?

@przhkv
Copy link

przhkv commented Dec 1, 2024

Upgrading to version 9 I found that working solution is:

commitlint -E $1

As according to migration guide:

HUSKY_GIT_PARAMS environment variable is replaced now by native params $1, $2, etc.

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

No branches or pull requests

5 participants