Open doughlass opened 1 year ago
Ugh, thanks.
Need to check but I think commitlint went from husky v8.0.1 to v8.0.3. Will try to find time and see if there's an issue.
If this is a general issue more people will roll in soon I guess. Lets' see.
Ugh, thanks. Need to check but I think commitlint went from husky v8.0.1 to v8.0.3. Will try to find time and see if there's an issue. If this is a general issue more people will roll in soon I guess. Lets' see.
Sorry for raising it π
The workaround I have to change the file to read node node_modules/@commitlint/cli/lib/cli.js --edit $1
seems to work.
Hoping that you and the other collaborators can have an official solution for the npx
command soon
I added a duplicate issue #3518 but closed it
here are the details:
$ npx commitlint --edit
β§ input: dfds
β subject may not be empty [subject-empty]
β type may not be empty [type-empty]
β Jira issue reference must be in the subject [jira-issue-reference-in-subject]
β found 3 problems, 0 warnings
β Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
> nestjs-bff-mobile-grooming@0.0.0-development lint
> eslint "{src,apps,libs,test}/**/*.ts" --fix && npm run prettier:check
> nestjs-bff-mobile-grooming@0.0.0-development prettier:check
> prettier --check . --ignore-path .gitignore --ignore-unknown
Checking formatting...
All matched files use Prettier code style!
.husky/commit-msg: line 4: 76524 Segmentation fault: 11 npx commitlint --edit
husky - commit-msg hook exited with code 139 (error)
No response
https://github.com/conventional-changelog/commitlint#getting-started
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx commitlint --edit
### commitlint --version
@commitlint/cli@17.4.2
### git --version
git version 2.33.0
### node --version
v18.13.0
Thanks!
Same problem.
I tried using husky both v8.0.0 and v8.0.3 but no success. I tried to set up this with using yarn
I have two commands in pre-commit file.
1) npx pretty-quick --staged
β this works fine, see logs below and other commands too like npm -v, echo
2) npx eslint .
β this does not work (but works without husky)
logs
π Finding changed files since git revision f78a10a.
π― Found 0 changed files.
β
Everything is awesome!
.husky/pre-commit: line 5: 53058 Segmentation fault: 11 npx eslint .
husky - pre-commit hook exited with code 139 (error)
Completed with errors, see above
.husky/pre-commit
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx pretty-quick --staged
npx eslint .
I am using MacBook Pro with Chip: Apple M1 Max
try using a different version of node, for example 16.19.0, it helped me
According to latest comment this can be fixed by using a newer node version
I was using 18.13.0
as stated above
The original poster was using 18 too
I was using
18.13.0
as stated above The original poster was using 18 too
Ah thanks, sorry
Had this issue for a while now until I stumbled with this issue and read through the comments, can confirm upgrading the node version to 20.11.1
solved this for me.
Expected Behavior
I should be able to commit and Husky runs the commit-msg hook and lints the commit message.
Current Behavior
Unable to proceed to commit due to the following error:
My
commit-msg
file is as follows:This is only in the past day I started to receive this error.
If I alter
npx commitlint --edit ${1}
to benpx commitlint@17.3.0 --edit ${1}
I am asked by npx to install17.3.0
and once installed thecommitlint
works as expected.It seems to be since
17.4.0
was released.Affected packages
Possible Solution
If I change
commit-msg
to replace thenpx
command tonode node_modules/@commitlint/cli/lib/cli.js --edit $1
I am able to run the commitlint against my message as my local is 17.4.0, it works as expected. Possibly an issue with npx?Steps to Reproduce
Context
Unable to commit using commitlint
commitlint --version
@commitlint/cli@17.4.0
git --version
2.39.0
node --version
v18.12.1