Skip to content

commitizen uses wrong version of cz-conventional-changelog #478

Closed
@rifler

Description

@rifler

In my package.json:

...
"commitizen": "2.9.6",
"cz-conventional-changelog": "^2.1.0"
...

<projectDir>/.czrc:

{ "path": "cz-conventional-changelog" }
# I've also tried
# { "path": "./node_modules/cz-conventional-changelog" }

Then I run npm run cz (it is just simply git-cz) and get these questions:

? Select the type of change that you're committing: feat:     A new feature
? Denote the scope of this change ($location, $browser, $compile, etc.):
 
? Write a short, imperative tense description of the change:
 asd
? Provide a longer description of the change:
 qweqwe
? List any breaking changes or issues closed by this change:

Questions about breaking changes and issues are combined into one, but I googled, that in one of the new releases of cz-conventional-changelog this behaviour was changed - commitizen/cz-conventional-changelog#44

Ok, let's grep old combined message

grep -r "List any breaking changes or issues closed by this change" ./node_modules 

./node_modules/commitizen/node_modules/cz-conventional-changelog/engine.js:          message: 'List any breaking changes or issues closed by this change:\n'

And some code from related pull request

grep -r "breaking = breaking ? 'BREAKING CHANGE: ' + breaking.replace" ./node_modules

./node_modules/cz-conventional-changelog/engine.js:        breaking = breaking ? 'BREAKING CHANGE: ' + breaking.replace(/^BREAKING CHANGE: /, '') : '';

Then I noticed debug messages from commitizen:

npm run cz --loglevel=error

> @[email protected] cz /Users/rifler/Documents/projects/my-project
> git-cz

[email protected], [email protected] // <---this line


Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

? Select the type of change that you're committing: (Use arrow keys)

Why does it use 1.2.0, while I have 2.1.0 in ./node_modules/cz-conventional-changelog ?
It turns out that commitizen uses wrong version of cz-conventional-changelog - it own version, but not installed by myself.
Can you please help me with this strange behaviour ?
Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions