我根据此处给出的说明http://www.jfrog.com/confluence/display/RTF/Npm+Repositories设置了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
我使用的命令是:
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'
我错过了什么?
答案 0 :(得分:3)
您应该升级您的npm客户端并使用至少1.4.3。
原因是发布命令已更改,Artifactory支持更新的格式。