np icon indicating copy to clipboard operation
np copied to clipboard

Fatal: No names found, cannot describe anything

Open 0x80 opened this issue 4 years ago • 4 comments

Description

After failed publish, in subsequent attempts I keep getting:

"fatal: No names found, cannot describe anything"

Command failed with exit code 128: git describe --abbrev=0 --tags fatal: No names found, cannot describe anything.

Steps to reproduce

  1. Try to publish with --any-branch, using a branch that has no remote branch yet.
  2. np will fail because of the missing remote branch, as expected.
  3. Remove the local commit made by np in which the package.json version was changed
  4. Publish the branch to git remote
  5. Run np --any-branch again.
  6. Error

Expected behavior

Environment

np - 6.1.0 Node.js - 10.16.3 npm - 6.9.0 Git - 2.21.0 OS - MacOS 10.15.3

0x80 avatar Feb 25 '20 14:02 0x80

This also seems to happen on a master branch where there is no earlier tag, as git describe --abbrev=0 --tags returns a string, but is actually an error message. Or at least this seems to be the problem on first glance...

dadadidudu avatar Apr 07 '20 18:04 dadadidudu

Capture

I tried to re-create this issue, and for me when the branch was missing a remote, np skipped that step, and went on to open the release draft and publish as well. Any one have a setup where we can re-create this issue?

dopecodez avatar Jul 07 '20 08:07 dopecodez

+1 I published a package before from npm using npm publish directly and now I'm using np now to publish and it gives the same error. image np config:

  "np": {
    "yarn": false,
    "anyBranch": true,
    "branch": "master",
    "contents": "dist"
  },

#452

5achinJani avatar Sep 08 '20 14:09 5achinJani

I think yours is similar to #452 . Did you try the solutions posted there? Looks like np is failing when trying to parse your git logs. Also, if you're publishing from master, you shouldn't need to have anyBranch or branch property in your config.

dopecodez avatar Sep 08 '20 15:09 dopecodez

Duplicate of https://github.com/sindresorhus/np/issues/452

fregante avatar Feb 03 '23 11:02 fregante