【问题标题】:Artifactory npm publish failed PUT 404Artifactory npm 发布失败 PUT 404
【发布时间】:2017-03-29 17:06:41
【问题描述】:

我正在尝试将作用域 npm 包发布到工件,但出现以下错误:

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>

我已通过以下方式设置了我的 .npmrc 文件:

registry=http://artifacts.company.com/artifactory/api/npm/npm-local/
_auth="mypassword"
always-auth=true
email=d.griner@company.com
@acres:registry=http://artifacts.company.com/artifactory/api/npm/npm-local/
//artifacts.company.com/artifactory/api/npm/npm-local/:_password=mypassword
//artifacts.company.com/artifactory/api/npm/npm-local/:username=myusername
//artifacts.company.com/artifactory/api/npm/npm-local/:email=d.griner@company.com
//artifacts.company.com/artifactory/api/npm/npm-local/:always-auth=true

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

【问题讨论】:

  • 我遇到了同样的异常。
  • 丹尼尔我刚刚添加了一个对我有用的答案。如果您落后于 Maven,那可能是您的问题。我从github.com/npm/npm/issues 那里得到了很多帮助。我也想试试。
  • 我也有同样的问题。 npm 错误!代码 E404 npm 错误! 404 未找到 - PUT npm.pkg.github.com/xxxxx npm ERR! 404 npm 错误! 404 'xxxxx' 不在 npm 注册表中。 npm 错误! 404 你应该让作者发布它(或自己使用名称!)npm ERR! 404 npm 错误! 404 请注意,您也可以从 npm ERR 安装! 404 tarball、文件夹、http url 或 git url。我有 npm 版本:6.13.4 并且在 package.json 中我没有“engines”组。

标签: json node.js scope npm artifactory


【解决方案1】:

我在 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.

【讨论】:

    【解决方案2】:

    我发现,如果工件位于 maven 后面,那么还有几个步骤可以让作用域包与工件一起使用。 https://techblog.dorogin.com/setting-up-artifactory-as-npm-repository-behind-apache-7541d5140492#.z0q412z5j

    基本上:

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

    【讨论】:

      猜你喜欢
      • 2022-10-20
      • 2015-10-25
      • 2021-12-23
      • 1970-01-01
      • 2023-02-14
      • 2021-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多