sindresorhus / np

A better `npm publish`
MIT License
7.57k stars 298 forks source link

Command failed with exit code 128 #452

Open slothsoft opened 5 years ago

slothsoft commented 5 years ago

Description

I tried to publish my module for the very first time (with a brand new npm account as well) and kept getting this error:

>np

Publish a new version of @slothsoft/qunit-reporter (current: 0.1.0)

× Command failed with exit code 128 (Unknown system error -128): git log --format=%s %h d50e9cd0795af9d12371e0418ea95bc3b569d8a0
22b547a9c8b8804d3d35d0cb1645f378c9d46f31..HEAD

However npm publish --access public worked perfectly.

Steps to reproduce

I cannot reproduce it any longer, the command np works now. I assume that the problem has to do with a new module and / or new npm account.

Though there might be a problem with the configuration, here is the tag of the project that produced the error: qunit-reporter/v0.1.0 (Although that doesn't explain why it works now without any changes to the package.json but the version number increment.)

Expected behavior

I expected for np to start normally, not fail.

Environment

np - 5.1.0 (I tried with np globally installed and as module dependency) Node.js - 10.15.3 npm - 6.11.2 Git - 2.20.1.windows.1 OS - Win 10 Pro v1903

r3code commented 5 years ago

+1 at Windows 10 x64 Nodejs 10.16.3 LTS

chinesedfan commented 5 years ago

This is due to your repository has 2 initial commits, which results in our firstCommit function in git-utils.js doesn't work as expected. After a tag was created, it will not be called.

I think we can return any one of them.

inkeytech commented 4 years ago

Hello,

I'm encountering the same issue.

I have already committed the package to Github more than once, before installing NP.

Is there a quick fix / workaround?

Regards,

Ian Watson

nrwinner commented 4 years ago

@inkeytech and anyone encountering this, it's possible to rebase your branch to squash the multiple initial commits into one commit. I found a comment with the steps for doing so here.