Np跳过了草稿发布步骤

时间:2019-08-09 21:17:15

标签: npm np

np完全跳过了草案发布步骤,而且我不知道我是如何做到的。

首先,它跳过推送标签,因为它“未检测到上游分支”。这对我来说很奇怪,因为它必须以某种方式推动更改。然后,我输入git push --set-upstream origin master,然后处理标签推送。现在,它推送标签...但是跳过了发布草稿步骤。我没有使用任何标志,仅使用np

我不知道该如何复制。我已经尝试了多个项目;我尝试卸载然后重新安装np,但是草稿发布步骤并未执行。

我看过:

  • #431(实际上抛出错误,我的没有错误)
  • #382(显示“命令失败”,我的显示什么都没有)和其他分支机构来表达想法-没有骰子。

这是我的终端机(GNU bash,版本4.4.19(1)-发行版(x86_64-pc-msys))的样子。

Publish a new version of testfordraftrelease (current: 1.0.1)

? No commits found since previous release, continue? (y/N) y
? No commits found since previous release, continue? Yes
? Select semver increment or specify new version (Use arrow keys)
? Select semver increment or specify new version patch  1.0.2

[02:51:34] Prerequisite check [started]
[02:51:34] Ping npm registry [started]
[02:51:36] Ping npm registry [completed]
[02:51:36] Check npm version [started]
[02:51:37] Check npm version [completed]
[02:51:37] Verify user is authenticated [started]
[02:51:41] Verify user is authenticated [completed]
[02:51:41] Check git version [started]
[02:51:41] Check git version [completed]
[02:51:41] Check git remote [started]
[02:51:43] Check git remote [completed]
[02:51:43] Validate version [started]
[02:51:43] Validate version [completed]
[02:51:43] Check for pre-release version [started]
[02:51:43] Check for pre-release version [completed]
[02:51:43] Check git tag existence [started]
[02:51:45] Check git tag existence [completed]
[02:51:45] Prerequisite check [completed]
[02:51:45] Git [started]
[02:51:45] Check current branch [started]
[02:51:45] Check current branch [completed]
[02:51:45] Check local working tree [started]
[02:51:45] Check local working tree [completed]
[02:51:45] Check remote history [started]
[02:51:45] Check remote history [completed]
[02:51:45] Git [completed]
[02:51:45] Cleanup [started]
[02:51:45] Cleanup [completed]
[02:51:45] Installing dependencies using npm [started]
[02:51:47] → npm WARN testfordraftrelease@1.0.1 No repository field.
[02:51:47] → up to date in 0.295s
[02:51:47] → found 0 vulnerabilities
[02:51:47] → [object Object]
[02:51:47] Installing dependencies using npm [completed]
[02:51:47] Running tests using npm [started]
[02:51:48] → > testfordraftrelease@1.0.1 test C:\Users\Choppy\Documents\Actual Documents\Coding\Actual Projects\Test
[02:51:48] → > echo 'Hi'
[02:51:48] → 'Hi'
[02:51:48] → [object Object]
[02:51:48] Running tests using npm [completed]
[02:51:48] Bumping version using npm [started]
[02:51:49] → v1.0.2
[02:51:49] → [object Object]
[02:51:49] Bumping version using npm [completed]
[02:51:49] Publishing package using npm [started]
[02:51:51] Publishing package using npm (waiting for input…) [title changed]
[02:51:51] → ? Enter OTP:
841029
? Enter OTP: 8
? Enter OTP: 84
? Enter OTP: 841
? Enter OTP: 8410
? Enter OTP: 84102
? Enter OTP: 841029
? Enter OTP: 841029
[02:51:55] → undefined
[02:51:55] Publishing package using npm [title changed]
[02:52:00] Publishing package using npm [completed]
[02:52:00] Pushing tags [started]
[02:52:04] Pushing tags [completed]

 testfordraftrelease 1.0.2 published ?

预期行为

我希望每当我使用np时都会发生草稿发布步骤,并且不会发生任何错误。

环境

np-5.0.3 Node.js-10.16.0 npm-6.10.2 Git-2.16.2.windows.1 操作系统-Windows 8.1

1 个答案:

答案 0 :(得分:0)

搜索了np包的util.js,cli.js,ui.js和index.js之后,我了解到它(至少是发行版)没有通过git文件夹检测到GitHub存储库。它通过package.json检测到它。

这意味着,如果您在npm init之前git init打包,则不会将GitHub存储库添加到package.json文件。如果您忘记或不知道手动添加它,np将跳过发布草稿阶段。

这需要更新以从git / git目录中获取存储库信息,或者需要echo / console.log以使用户更新其package.json文件。

package.json,其中np 没有起草发布:

{
  "name": "testfordraftrelease",
  "version": "1.0.11",
  "description": "Using this to test np",
  "main": "index.js",
  "scripts": {
    "test": "echo 'Hi'"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

package.json,其中np did 起草了一个发布版本:

{
  "name": "testfordraftrelease",
  "version": "1.0.11",
  "description": "Using this to test np",
  "main": "index.js",
  "scripts": {
    "test": "echo 'Hi'"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Crowbrammer/TestRepoForNP.git"
  },
  "bugs": {
    "url": "https://github.com/Crowbrammer/TestRepoForNP/issues"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}