Artifactory npm发布失败的PUT 404

时间:2016-11-15 17:36:11

标签: json node.js scope npm artifactory

我正在尝试将范围内的npm包发布到artifactory,我收到以下错误:

if A == B:
    [not lowest terms]
if A is a multiple of B:
    [not lowest terms]
if there is a common divisor: // this catches the first two.
    [not lowest terms]
else:
    [lowest terms]

我已按以下方式设置我的.npmrc文件:

npm ERR! registry error parsing json
npm ERR! publish Failed PUT 404
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node4-lts/4.6.2/bin/node" "/usr/local/bin/npm" "publish"
npm ERR! node v4.6.2
npm ERR! npm  v2.15.9

npm ERR! Unexpected token <
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /artifactory/api/npm/npm-local/@acres/acresmetajs was not found on this server.</p>
npm ERR! <hr>
npm ERR! <address>Apache/2.2.31 (Amazon) Server at artifacts.company.com Port 80</address>
npm ERR! </body></html>

我运行npm publish和npm publish --registry http://artifacts.company.com/artifactory/api/npm/npm-local/并得到同样的错误。我错过了什么?

2 个答案:

答案 0 :(得分:1)

我发现如果它落后于maven,还有一些步骤可以让scoped包与artifactory一起使用。 https://techblog.dorogin.com/setting-up-artifactory-as-npm-repository-behind-apache-7541d5140492#.z0q412z5j

本质:

  • AllowEncodedSlashed设置为NoDecode(默认情况下为Off)
  • 为ProxyPass添加了关键字nocanon,它告诉mod_proxy模块不要规范化URL

答案 1 :(得分:0)

我在6.5.0版本上得到了这个。解决方案是从package.json中删除“ engines”组。

npm ERR! publish Failed PUT 404
npm ERR! code E404
npm ERR! 404 NotFound The package 'xxxxxxxx' was not found in feed 'npmjs': xxxxxxxx
npm ERR! 404
npm ERR! 404  'xxxxxxxx' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.