question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'conventional-changelog-conventionalcommits' when using parserPreset

See original GitHub issue

When I try to add parserPreset to my commitlint.config.js, I receive the following error:

C:\Program Files\nodejs\node_modules\@commitlint\cli\lib\cli.js:119
        throw err;
        ^
Error: Cannot find module 'conventional-changelog-conventionalcommits'
    at Function.Module._resolveFilename (module.js:538:15)
    at resolveFileName (C:\Program Files\nodejs\node_modules\@commitlint\cli\node_modules\resolve-from\index.js:29:39)
    at resolveFrom (C:\Program Files\nodejs\node_modules\@commitlint\cli\node_modules\resolve-from\index.js:43:9)
    at module.exports (C:\Program Files\nodejs\node_modules\@commitlint\cli\node_modules\resolve-from\index.js:46:47)
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\@commitlint\cli\node_modules\@commitlint\load\lib\index.js:54:54)
    at <anonymous>

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

  1. Install @commitlint/cli, @commitlint/config-conventional (and optionally my plugin commitlint-plugin-cleanfeet)
  2. Ensure parserPreset: 'conventional-changelog-conventionalcommits', is present in commitlint.config.js
  3. Execute echo 'chore: Stuff' | commitlint
commitlint.config.js
module.exports = {
	parserPreset: 'conventional-changelog-conventionalcommits',
	extends: ['@commitlint/config-conventional'],
	plugins: ['cleanfeet'],
	rules: {
		'footer-format': [
			2, 
			'always', 
			[
				'^BREAKING CHANGE: .*',
				'^[a-zA-Z0-9-]+: .*',
				'^[a-zA-Z0-9-]+ #.*'
			]
		],
		'footer-max-occurrence-breaking-change': [2, 'always', { max: 1, regex: /^BREAKING CHANGE: .*$/ }]
	}
};

Your Environment

Executable Version
commitlint --version 8.2.0
git --version 2.16.1.windows.4
node --version v8.9.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
byCedriccommented, Nov 4, 2019

I think your NPM might be a bit confused because of commitlint and @commitlint/cli. commitlint is just an alias package that calls @commitlint/cli. Could you try installing @commitlint/cli@next without commitlint@next?

1reaction
CrispyDronecommented, Nov 5, 2019

Yes you were right. Thank you very much for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conventional-changelog-conventionalcommits - npm
Start using conventional-changelog-conventionalcommits in your project by running `npm i conventional-changelog-conventionalcommits`.
Read more >
reactjs - Jest - Referencing local files gives package link error
When I try and run jest, I get the following error that makes my test file fail: ... Is it something to do...
Read more >
'--format', 'pretty', gives me Error: Cannot find module '/project ...
Error: Cannot find module '/project/pretty. I feel like I am missing something simple but cannot find anything about this. --format pretty.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found