【问题标题】:npm publish to Artifactory not workingnpm 发布到 Artifactory 不起作用
【发布时间】:2014-11-19 18:26:55
【问题描述】:

我已根据此处给出的说明设置 Artifactory,http://www.jfrog.com/confluence/display/RTF/Npm+Repositories,但在发布包时会显示以下内容:

npm http PUT http://localhost:8083/artifactory/api/npm/npm-local/UIBase
npm http 400 http://localhost:8083/artifactory/api/npm/npm-local/UIBase
npm ERR! registry error parsing json
npm ERR! publish Failed PUT response 400
npm ERR! SyntaxError: Unexpected token M
npm ERR! Missing attachments with tarball data, aborting upload for: 'UIBase'
npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:238:23)
npm ERR!     at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:920:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.13.0-39-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "publish" "--registry" "http://localhost:8083/artifactory/api/npm/npm-local"
npm ERR! cwd /home/debjit/code/pubmatic/pub-mgmt/ui/UIBase
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type unexpected_token
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/debjit/code/pubmatic/pub-mgmt/ui/UIBase/npm-debug.log
npm ERR! not ok code 0

我使用的命令是:

npm publish --registry http://localhost:8083/artifactory/api/npm/npm-local

Artifactory 日志显示如下:

2014-11-19 23:15:23,541 [http-bio-8083-exec-2] [WARN ] (o.j.r.n.r.h.NpmLocalRepoHandler:192) - Missing attachments with tarball data, aborting upload for: 'UIBase'

我错过了什么?

【问题讨论】:

    标签: npm artifactory


    【解决方案1】:

    您应该升级您的 npm 客户端并至少使用 1.4.3。

    原因是发布命令发生了变化,Artifactory 支持更新的格式。

    【讨论】:

    • 感谢您的指点。我还尝试了 npm 2.1.8,它似乎不受支持,因为我得到了2014-11-21 08:29:23,316 [http-bio-8083-exec-1] [ERROR] (o.a.a.n.r.NpmResource:98) - Unsupported npm repository request for 'uibase'。是否有文档说明支持哪些版本?
    • npm 2.x 存在几个问题。看到这张票:github.com/npm/npm-registry-client/issues/78 基本上你应该尝试添加一个尾随/ 例如:npm publish --registry http://localhost:8083/artifactory/api/npm/npm-local/
    猜你喜欢
    • 2017-03-29
    • 2022-12-10
    • 2015-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多