cz-conventional-changelog icon indicating copy to clipboard operation
cz-conventional-changelog copied to clipboard

cz.prompt(...).then is not a function

Open bmayen opened this issue 9 years ago • 4 comments

Getting the following error on [email protected]:

node_modules/cz-conventional-changelog/index.js:79
    ]).then(function(answers) {
       ^

TypeError: cz.prompt(...).then is not a function
    at module.exports.prompter (node_modules/cz-conventional-changelog/index.js:79:8)
    at commit (.nvm/versions/node/v5.10.1/lib/node_modules/commitizen/dist/commitizen/commit.js:68:5)
    at .nvm/versions/node/v5.10.1/lib/node_modules/commitizen/dist/cli/strategies/git-cz.js:89:30
    at .nvm/versions/node/v5.10.1/lib/node_modules/commitizen/dist/commitizen/staging.js:30:5
    at .nvm/versions/node/v5.10.1/lib/node_modules/commitizen/node_modules/gulp-git/lib/exec.js:27:5
    at ChildProcess.exithandler (child_process.js:193:7)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)

v1.1.5 appears to work as expected.

bmayen avatar Apr 25 '16 16:04 bmayen

This is because of an older global version of commitizen. A npm update -g commitizen does help and solve the issue.

In this case the wire between the global module and the locally installed one should either be tightened or removed.

aklinkert avatar Apr 26 '16 13:04 aklinkert

@apinnecke is correct. This is 100% my fault although hopefully I can provide a bit of background:

Inquirer.js went to 1.0.0 after being in 0.0 for a long time. I missed the breaking changes that were included. Typically my understanding is that when going from 0.0 to 1.0 you won't have any breaking changes from the last few 0.0 releases since you're indicating that your product is finally stable. This was a BAD assumption on my part. As it turns out there was very much a breaking change. Now that Inquirer is at 1.0.0, future breaking change releases (meaning going to 2.. or 3.. will be easier to spot). Nevertheless my apologies for introducing this issue.

At this point the solution is to make sure you're on 2.8.1 of the commitizen cli or higher and the latest version of this adapter (1.1.6 or higher) and you should be ok.

jimthedev avatar Apr 27 '16 00:04 jimthedev

Could you try updating the path to cz-conventional-changelog instead of node_modules/cz-conventional-changelog?

sarbbottam avatar May 06 '16 03:05 sarbbottam

@jimthedev this could be fixed with specify a peerDependency of commitizen @ >= 2.8.1, meaning that everyone will get told to update if they're not up-to-date

ThisIsMissEm avatar Jul 29 '20 02:07 ThisIsMissEm