使用 np 包发布到 npm 或 yarn

Using np package to publish to npm or yarn

我正在尝试使用 np 将包发布到 npm。一切似乎都很顺利,直到它遇到版本号的问题。我不知道出了什么问题。

  ✔ Prerequisite check
  ✔ Git
  ✔ Cleanup
  ✔ Installing dependencies using npm
  ✔ Running tests using npm
  ✖ Bumping version using npm
    → v1.0.3
    Publishing package using npm
    Pushing tags

✖ Command failed: npm version 1.0.3
npm ERR! code 128
npm ERR! Command failed: git tag v1.0.3 -sm 1.0.3
npm ERR! error: cannot run gpg: No such file or directory
npm ERR! error: gpg failed to sign the data
npm ERR! error: unable to sign the tag
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ds/.npm/_logs/2019-06-28T13_11_44_469Z-debug.log

v1.0.3

问题是我将 version-sign-git-tag 设置为 true,并且由于我的机器上没有安装 gpg,所以标签签名失败。将标志设置为 false 解决了这个问题。我猜这不是最好的方法,但最快。