np
np copied to clipboard
Fatal: No names found, cannot describe anything
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
- Try to publish with --any-branch, using a branch that has no remote branch yet.
-
np
will fail because of the missing remote branch, as expected. - Remove the local commit made by
np
in which the package.json version was changed - Publish the branch to git remote
- Run
np --any-branch
again. - 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
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...
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?
+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.
np config:
"np": {
"yarn": false,
"anyBranch": true,
"branch": "master",
"contents": "dist"
},
#452
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.
Duplicate of https://github.com/sindresorhus/np/issues/452