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

Cannot find module 'commitizen' #89

Closed
travi opened this issue Jul 21, 2019 · 5 comments · Fixed by #90 · May be fixed by ReidWeb/GitInspector-CSV#61
Closed

Cannot find module 'commitizen' #89

travi opened this issue Jul 21, 2019 · 5 comments · Fixed by #90 · May be fixed by ReidWeb/GitInspector-CSV#61
Labels

Comments

@travi
Copy link
Contributor

travi commented Jul 21, 2019

after the latest release, i am seeing the following error when running git cz the same way i always have: Cannot find module 'commitizen'. I noticed the same problem when attempting to test this PR, but assumed at the time that I was simply pulling it down incorrectly during my attempt to test.

The simplest way to reproduce is probably to

i'll try to find a chance to dig a bit to see if i can understand why this is happening for me and will add comments if i find anything, but wanted to at least get this opened in case the cause might be obvious to one of the core team.

@travi
Copy link
Contributor Author

travi commented Jul 21, 2019

i notice that if i install commitizen locally, things work again, so it seems that git cz is not finding the globally installed version for some reason

@travi
Copy link
Contributor Author

travi commented Jul 21, 2019

looks to me like the issue is the direct dependency on the commitizen package in order to use its config loader. This package only marks commitizen as a devDependency, so when commitizen is installed globally, but cz-conventional-changelog is installed locally, it isn't able to access commitizen.

i'll put up a PR to mark commitizen as a dependency instead of a devDependency. i could see this as a potential reason to split the config loader to a separate package, but that decision is totally in your hands.

@commitizen-bot
Copy link

🎉 This issue has been resolved in version 3.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to DawChihLiou/cz-conventional-changelog-with-jiraid-detection that referenced this issue Sep 16, 2020
# 1.0.0 (2020-09-16)

### Bug Fixes

* **adapter:** Fix typo in etc. ([39182b8](39182b8))
* **build:** Add proper deps, force republish to make sure things are working ([922097b](922097b))
* **build:** Automatic releases!!! ✨ ([114f967](114f967))
* update longest to ^2 ([commitizen#88](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/88)) ([7234529](7234529))
* **commit:** Remove es6 string syntax (backticks) ([7f922f2](7f922f2))
* **commit:** remove parentheses when there is no scope present ([55f72b9](55f72b9))
* **config-loader:** captured the direct dependency on commitizen for the use of the config loader ([commitizen#90](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/90)) ([4b23bbc](4b23bbc)), closes [commitizen#89](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/89)
* **defaultValues:** Added fallback for optional default values ([commitizen#99](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/99)) ([2aae317](2aae317))
* **package.json:** install missing dependency ([4287211](4287211))
* **package.json:** update package name ([2985968](2985968))
* **prompter:** resolve issue with new inquirer api ([commitizen#18](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/18)) ([807b4e5](807b4e5))
* Correct typo in JSON ([58df4d1](58df4d1))
* **release:** attempt to fix release ([c167fd8](c167fd8))
* **release.config.js:** attempt to fix semantic release ([e362f9a](e362f9a))
* **require:** get rid of relative path to the word-wrap ([e98818a](e98818a)), closes [commitizen#4](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/4)
* **wrapping:** Fix fields to wrap instead of truncate at 100 characters ([c7b7e11](c7b7e11)), closes [commitizen/cz-cli#4](commitizen/cz-cli#4)
* remove pre-node 10 support ([commitizen#86](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/86)) ([76588ad](76588ad))
* Update conventional-commit-types to the latest version 🚀 ([commitizen#105](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/105)) ([5a371c1](5a371c1))
* Wrap updateTypes in packageRules ([0f6dfbf](0f6dfbf))

### Features

* **adapter:** Create initial commit. ([4e8da01](4e8da01))
* **adapter:** refactor to engine, default to conventional commit types ([c8452d1](c8452d1)), closes [commitizen#29](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/29)
* **adapter:** Split breaking changes into separate question ([commitizen#44](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/44)) ([2d78e1d](2d78e1d)), closes [commitizen#17](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/17)
* add default values to options ([commitizen#69](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/69)) ([65d6a9f](65d6a9f))
* implement configuration through package.json ([commitizen#75](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/75)) ([3398c02](3398c02))
* **engine:** add support for disableScopeLowerCase ([commitizen#96](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/96)) ([e7bd546](e7bd546))
* **engine:** add support for disableSubjectLowerCase ([df66875](df66875))
* **engine.js:** add jira step ([b6c6bfb](b6c6bfb))
* **prompt:** add confirmation fields + edit for clarity ([commitizen#58](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/58)) ([d40ac2c](d40ac2c)), closes [commitizen#52](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/52)
* **types:** add suport for custom types ([commitizen#104](https://github.com/DawChihLiou/cz-conventional-changelog-with-jiraid-detection/issues/104)) ([aae2548](aae2548))

### BREAKING CHANGES

* Node 10 is LTS so please upgrade to it.
* **adapter:** Breaking changes now automatically include the "BREAKING CHANGE: " prefix.
@morphatic
Copy link

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"
    }
  }

This is actually what's documented in the setup instructions 😅 so I'm just putting this here in case it helps anyone.

@michaelmccallam
Copy link

@morphatic thanks for this. I got the message 'Could not resolve' after following the docs and installing -g and also setting up the repo to be Comitizen friendly.
I updated the package.json config as you suggested

"config": { "commitizen": { "path": "cz-conventional-changelog" } }
and it now works! - this was effecting cz-cli@4.3.0, cz-conventional-changelog@3.3.0

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