npm发布到Artifactory不工作

npm发布到Artifactory不工作,npm,artifactory,Npm,Artifactory,我已根据此处给出的说明设置了Artifactory,但发布包时会显示以下内容: 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 r

我已根据此处给出的说明设置了Artifactory,但发布包时会显示以下内容:

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
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客户端并至少使用1.4.3


原因是publish命令已更改,并且Artifactory支持较新的格式。

感谢您提供的指针。我还尝试了npm 2.1.8,它似乎不受支持,因为我得到了
2014-11-21 08:29:23316[http-bio-8083-exec-1][ERROR](o.a.a.n.r.NpmResource:98)-不受支持的“uibase”npm存储库请求
。是否有文档指定支持哪些版本?npm 2.x有几个问题。查看此票证:基本上,您应该尝试添加一个尾随的
/
,例如:
npm publish--registryhttp://localhost:8083/artifactory/api/npm/npm-本地/
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'