cz-cli icon indicating copy to clipboard operation
cz-cli copied to clipboard

Cannot find module 'git-branch'

Open BartusZak opened this issue 4 years ago • 1 comments

Hey,

I can not run commitizen.

Error:

yarn cz
yarn run v1.22.17
$ /home/bartuszak/gitlab/web-common/node_modules/.bin/cz
Cannot find module 'git-branch'
Require stack:
- /home/bartuszak/gitlab/web-common/commitizen.js
- /home/bartuszak/gitlab/web-common/node_modules/commitizen/dist/commitizen/adapter.js
- /home/bartuszak/gitlab/web-common/node_modules/commitizen/dist/commitizen.js
- /home/bartuszak/gitlab/web-common/node_modules/commitizen/dist/cli/git-cz.js
- /home/bartuszak/gitlab/web-common/node_modules/commitizen/bin/git-cz.js
- /home/bartuszak/gitlab/web-common/node_modules/commitizen/bin/git-cz
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

"commitizen": "4.2.1",

OS:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Thanks for any hints.

BartusZak avatar Nov 09 '21 08:11 BartusZak

I had a similar problem when updating an old package and in my case the problem was that in my package.json I had the following config:

  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }

I was getting the issue even when I'd updated to ^3.0.2, and found I had to update the config to:

  "config": {
    "commitizen": {
      "path": "cz-conventional-changelog"
    }
  }

Ref: https://github.com/commitizen/cz-conventional-changelog/issues/89

costaevangelista avatar Apr 17 '22 01:04 costaevangelista