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

RangeError: Invalid count value #476

Closed
1 of 4 tasks
sibelius opened this issue Oct 30, 2018 · 4 comments
Closed
1 of 4 tasks

RangeError: Invalid count value #476

sibelius opened this issue Oct 30, 2018 · 4 comments

Comments

@sibelius
Copy link

Expected Behavior

it should run commitmsg properly

Current Behavior

it throws an error

/Users/sibelius/Dev/app/app/app/node_modules/@commitlint/cli/lib/help.js:34
		return `${fs.join(',')}${' '.repeat(4 + longest - length)}${desc}${ds}`;
		                             ^

RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at /Users/sibelius/Dev/app/app/app/node_modules/@commitlint/cli/lib/help.js:34:32
    at Array.map (<anonymous>)
    at module.exports (/Users/sibelius/Dev/app/app/app/node_modules/@commitlint/cli/lib/help.js:23:15)
    at Object.<anonymous> (/Users/sibelius/Dev/app/app/app/node_modules/@commitlint/cli/lib/cli.js:55:76)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)

husky > commit-msg hook failed (add --no-verify to bypass)

I'm using simple-git to perform this commit:

import git from 'simple-git/promise';
await git().commit(`build(change-log): ${tag}`);

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

  1. await git().commit(build(change-log): ${tag});
commitlint.config.js ```js module.exports = { rules: { 'body-leading-blank': [1, 'always'], 'footer-leading-blank': [1, 'always'], 'header-max-length': [2, 'always', 100], 'scope-case': [2, 'always', 'lower-case'], 'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], 'subject-empty': [2, 'never'], 'subject-full-stop': [2, 'never', '.'], 'type-case': [2, 'always', 'lower-case'], 'type-empty': [2, 'never'], 'type-enum': [ 2, 'always', [ 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'migration', 'type', ], ], }, }; ```

Context

Your Environment

I'm using nvm (0.31.1)
macosx
"@commitlint/cli": "7.2.1",
"@commitlint/config-conventional": "7.1.2",
git version 2.19.1
hub version 2.5.1
node v10.12.0

@sibelius
Copy link
Author

for some reason this line

https://github.com/marionebl/commitlint/blob/master/%40commitlint/cli/src/help.js#L29

4 + longest - length

is -4 using my commitlint config

@dominikfiala
Copy link

dominikfiala commented Oct 31, 2018

Just run into this issue today with @commitlint v4.3.0, npm v11.0.0 so it seems to me that the issue is not @commitlint or node version related.

Edit: Resolved by downgrading node to v8.12.0.

@rturk
Copy link

rturk commented Nov 4, 2018

@dominikfiala makes sense, I've started to seen this bug after migrated to node 10x from node 8x

marionebl added a commit that referenced this issue Nov 8, 2018
* fix: use correct label for failing empty subjects, see #476

* chore: budge to husky api change

* test: adapt to corrected subject message
escapedcat pushed a commit that referenced this issue Nov 16, 2018
* fix: use correct label for failing empty subjects, see #476

* chore: budge to husky api change

* docs: use https for all external links in readme

* Fix dependency security issues (#474)

fix: solve dependency security issues

* chore: add global watch task
@marionebl
Copy link
Contributor

Fixed via f27e7ac

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

No branches or pull requests

4 participants