在 Nexus 3.19.1-01 中使用 npm dist-tag 时出现错误请求 (Http 400)

Getting Bad Request (Http 400) when using npm dist-tag with Nexus 3.19.1-01

我们 运行 Nexus OSS 3.19.1-01(带有 OpenJdk 1.8 的 CentOS7。0_222-b10)和 npm 存储库。一切正常,除了 npm dist-tag 功能,它现在应该适用于版本 >3.19.

$ npm publish <pkg> --tag bla  #--> works
$ npm install <pkg>@bla #--> works
$ npm dist-tag ls <pkg> #--> works

$ npm dist-tag rm --verbose @myscope/mypackage foo                    
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/usr/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'dist-tag',
npm verb cli   'rm',
npm verb cli   '--verbose',
npm verb cli   '@myscope/mypackage',
npm verb cli   'foo'
npm verb cli ]
npm info using npm@6.13.1
npm info using node@v12.13.0
npm verb npm-session 3b193197390df1cf
npm verb dist-tag del snapshot from @myscope/mypackage
npm http fetch GET 200 https://nexus.example.com/repository/npm-group/-/package/@myscope%2fmypackage/dist-tags 1396ms
npm http fetch DELETE 400 https://nexus.example.com/repository/npm-group/-/package/@myscope%2fmypackage/dist-tags/foo 9ms
npm verb stack Error: 400 Bad Request - DELETE https://nexus.example.com/repository/npm-group/-/package/@myscope%2fmypackage/dist-tags/foo
npm verb stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
npm verb stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb statusCode 400
npm verb pkgid @myscope/mypackage@latest
npm verb cwd /home/myname/path-to-code/mypackage/client
npm verb Linux 5.3.11-300.fc31.x86_64
npm verb argv "/usr/bin/node" "/usr/local/bin/npm" "dist-tag" "rm" "--verbose" "@myscope/mypackage" "foo"
npm verb node v12.13.0
npm verb npm  v6.13.1
npm ERR! code E400
npm ERR! 400 Bad Request - DELETE https://nexus.example.com/repository/npm-group/-/package/@myscope%2fmypackage/dist-tags/foo
npm verb exit [ 1, true ]
npm timing npm Completed in 1730ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myname/.npm/_logs/2019-11-20T13_02_41_234Z-debug.log

$ npm dist-tag add @myscope/mypackage@0.1.0 bar
# did not work, same error as above

nexus 日志中没有其他日志消息。

有什么想法吗?

恐怕它对你不起作用,因为你运行你的命令是针对 npm 组存储库的。从 NXRM 3.19.1 开始,npm dist-tag addnpm dist-tag rm 仅适用于托管存储库。但是,所有类型的存储库都支持 npm dist-tag ls(自 3.19.0 起)。