qoomon / git-conventional-commits

Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
https://short.qoo.monster/Conventional-Commits
GNU General Public License v3.0
379 stars 40 forks source link

git-conventional-commits init command throws an exception #130

Closed carpasse closed 1 year ago

carpasse commented 1 year ago

Hi

I get the following exception when I run git-conventional-changelog init

Error: ENOENT: no such file or directory, copyfile '/Users/my-user/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/lib/commands/../../commit-msg.sh' -> './.git/hooks/commit-msg'
    at Object.copyFileSync (node:fs:2866:3)
    at exports.handler (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/lib/commands/commandInit.js:29:12)
    at /Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:8891
    at j (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:4956)
    at M.handleValidationAndGetResult (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:8860)
    at M.applyMiddlewareAndGetResult (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:9502)
    at M.runCommand (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:7231)
    at [runYargsParserAndExecuteCommands] (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:57900)
    at Xt.parse (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/node_modules/yargs/build/index.cjs:1:40011)
    at Object.<anonymous> (/Users/carlos.pastor/.nvm/versions/node/v18.9.0/lib/node_modules/git-conventional-commits/cli.js:12:4) {
  errno: -2,

I've checked the folder and the file commit-msg.sh does not exist in the installation folder. I also don't see it on npm code preview of git-conventional-changelog package.

Maybe there was a problem with the release and the file was not uploaded properly when publishing. Not a blocker since I've copied the file from the master of the project but I thought you may want to take a look.

qoomon commented 1 year ago

Thanks for reporting, I'll take care.

qoomon commented 1 year ago

should be fixed in version 2.5.1. Thanks again.