如何在Nexus中重建NPM存储库的索引?

如何在Nexus中重建NPM存储库的索引?,npm,nexus,Npm,Nexus,我们有一个运行在64位RHEL6上的Nexus 2.11.4-01 PRO实例,该RHEL6承载多种类型的存储库。最近,所有NPM存储库都以某种方式损坏,任何在Windows上使用NPM发布NPM包的尝试都会失败,并出现以下错误: npm ERR! registry error parsing json npm ERR! registry error parsing json npm ERR! registry error parsing json npm ERR! publish Failed

我们有一个运行在64位RHEL6上的Nexus 2.11.4-01 PRO实例,该RHEL6承载多种类型的存储库。最近,所有NPM存储库都以某种方式损坏,任何在Windows上使用NPM发布NPM包的尝试都会失败,并出现以下错误:

npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! registry error parsing json
npm ERR! publish Failed PUT 500
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Programs\\nodejs-0.12.7\\\\node.exe" "D:\\Programs\\nodejs-0.12.7\\node_modules\\npm\\bin\\npm-cli.js" "publish"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3

npm ERR! Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <title>500 - We reached max level of depth of SBTree but still found nothing, seems like tree is in corrupted state. You should rebuild index related to given query.</title>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
npm ERR! 
npm ERR!     <link rel="icon" type="image/png" href="http://nexus:8081/nexus/favicon.png">
npm ERR!     <!--[if IE]>
npm ERR!     <link rel="SHORTCUT ICON" href="http://nexus:8081/nexus/favicon.ico"/>
npm ERR!     <![endif]-->
npm ERR! 
npm ERR!     <link rel="stylesheet" href="http://nexus:8081/nexus/static/css/Sonatype-content.css?2.11.4-01" type="text/css" media="screen" title="no title" charset="utf-8">
npm ERR!   </head>
npm ERR!   <body>
npm ERR!     <h1>500 - We reached max level of depth of SBTree but still found nothing, seems like tree is in corrupted state. You should rebuild index related to given query.</h1>
npm ERR!     <p>We reached max level of depth of SBTree but still found nothing, seems like tree is in corrupted state. You should rebuild index related to given query.</p>
npm ERR!   </body>
npm ERR! </html>
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\somewhere\npm-debug.log
npm错误!解析json时发生注册表错误
npm错误!解析json时发生注册表错误
npm错误!解析json时发生注册表错误
npm错误!发布失败PUT 500
npm错误!Windows NT 6.1.7601
npm错误!argv“D:\\Programs\\nodejs-0.12.7\\\\node.exe”D:\\Programs\\nodejs-0.12.7\\node\u modules\\npm\\bin\\npm cli.js“发布”
npm错误!节点v0.12.7
npm错误!npm v2.11.3
npm错误!意外标记<
npm错误!
npm错误!
npm错误!500-我们达到了SBTree的最大深度,但仍然没有找到任何东西,看起来树处于损坏状态。您应该重建与给定查询相关的索引。
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!500-我们达到了SBTree的最大深度,但仍然没有找到任何东西,看起来树处于损坏状态。您应该重建与给定查询相关的索引。
npm错误 我们达到了SBTree的最大深度,但仍然什么也没找到,似乎树处于损坏状态。您应该重建与给定查询相关的索引

npm错误! npm错误! npm错误! npm错误! npm错误!如果需要帮助,您可以在以下位置报告此错误: npm错误! npm错误!请在任何支持请求中包括以下文件: npm错误!D:\where\npm-debug.log
如日志所示

我们达到了SBTree的最大深度,但仍然什么也没找到,似乎树处于损坏状态。您应该重建与给定查询相关的索引

但我找不到如何重建该索引。我试图从管理员界面“修复索引”、“更新索引”,甚至“终止缓存”,应用程序“在用”和“停用”都没有任何运气


有什么想法吗?

我向支持团队询问了这个问题,他们回答(相当快,大约10分钟)如下:

要重建npm的索引,请执行以下操作:

  • 关闭nexus
  • 删除sonatype work/nexus/db/npm的内容
  • 重新启动
  • 计划“重建托管npm元数据”任务,以针对托管npm存储库运行
  • 您不需要为代理或组npm存储库执行任何操作, 这些将在重启后工作

    之后它就正常工作了

    附言:没有附属关系或任何东西