Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bmayen opened this issue Apr 25, 2016 · 4 comments
Open

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

bmayen opened this issue Apr 25, 2016 · 4 comments
Labels

Comments

@bmayen
Copy link

bmayen commented Apr 25, 2016

Getting the following error on cz-conventional-changelog@1.1.6:

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.

@aklinkert aklinkert mentioned this issue Apr 26, 2016
@aklinkert
Copy link

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.

@jimthedev
Copy link
Member

jimthedev commented Apr 27, 2016

@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.

@sarbbottam
Copy link

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

@ThisIsMissEm
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants