npm 发布到 Artifactory 不起作用

标签 npm artifactory

我已经按照此处给出的说明设置了 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!     <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddb3adb0f09dbab2b2bab1b8baafb2a8adaef3beb2b0" rel="noreferrer noopener nofollow">[email protected]</a>>

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

原因是发布命令已更改,Artifactory 支持更新的格式。

关于npm 发布到 Artifactory 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27024212/

相关文章:

node.js - Webpack 最终包大小太大

maven - 如何将 mvnrepository.com 添加到 artifactory 3.1

artifactory - 如何将 Jfrog Artifactory pro 升级到企业版或企业+版?

typescript - 尝试将节点模块导入 NuxtJS TypeScript 时出错(ES2018)

node.js - 将多个变量传递给 package.json 脚本

npm - Visual Studio 2017 无法在保存时恢复包

gradle - 通过Gradle上传到 Artifactory 时如何更改jar文件名

maven-2 - 需要演示 Material 来说服客户使用 Maven

gradle - 如何使用artifactoryPublish发布单个出版物

npm - 从同一个包中安装多个 npm 模块的简写