np: Fails on first time start with git rev-list error

Issuehunt badges

When run np (v3.0.4) first time on some repo it fails with this output:

Publish a new version of arrgv (current: 0.0.6)

✖ Command failed: git rev-list --tags --max-count=1
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
...
... and so on

Then if run ‘np major’ (or other command) it works as usual.

On repos, where np was successfully used before, this problem do not appears.

Maybe it is bug.

itaisteinherz earned $40.00 by resolving this issue!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 13
  • Comments: 16

Most upvoted comments

@astur A new version with the fix included has already been released - v4.0.0.

@astur Great 👍🏻 @sindresorhus I’m going to submit #322 to IssueHunt as a PR which fixes this since it seems to be the case here. Also, I think this can be closed now.

@itaisteinherz, it works great with latest version from GitHub.

@jjperezaguinaga solution works for me

Hey folks, also just bumped into this error in a repo in which I have never used np before.

I tried to just run npx np from a repo that currently has no tags, and which I’ve manually published the repo to npm once. Can’t think of any other discerning features of this repo.

I had a look at the error message that git provides & it seems the <commit-id> argument is missing.

✖ Command failed: git rev-list --tags --max-count=1
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]

(…confirmed by running git rev-list --tags --max-count=1 manually)

An obvious commit id would be HEAD, as in git rev-list --tags --max-count=1 HEAD, which does give me some kind of hash - I don’t know if that is the correct behavior, but I hope that’s helpful for anyone who might want to fix this 😃

Thanks to Sindre & the squad for this awesome module ✌️

I can confirm I was faced with the same issue when trying to run np on its own. Providing an argument like np 0.1.0 seems to have solved the issue in my case.