使用Nexus代理npm回购时出现EINTEGRITY错误



到目前为止,我们可以在.npmrc(registry = https://registry.npmjs.org/(中使用默认注册表来构建节点项目。我们想开始在本地npm存储库中发布我们的内部库-我们使用Nexus3。我创建了指向的代理回购https://registry.npmjs.org/(https://nexus.local/repository/npm-registry/)。当我们为该代理回购更改.npmrc中的registry时,构建相同的项目以以下错误结束:

npm WARN tarball tarball data for wildcard@https://nexus.local/repository/npm-registry/wildcard/-/wildcard-2.0.0.tgz (sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for minimist@https://nexus.local/repository/npm-registry/minimist/-/minimist-1.2.6.tgz (sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==) seems to be corrupted. Trying again.
npm ERR! code EINTEGRITY
npm ERR! sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== integrity checksum failed when using sha512: wanted sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== but got sha512-l5E0KJ9dH5bNZ9CxPNtF5KiMPlhF4eQZv7S2+Ko1HbeKTgRr9sMd8oe88VGS14dLESGihS27fqbDXq9d919xcw==. (33280 bytes)

正在检查有关的详细信息wildcard@2.0.0使用两种.npmrc配置的包返回相同的结果(尤其是相同的sha512值(:

[jenkins@jenkins-agent-02 tmp.build]$ ~/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_18.6.0/bin/node ~/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_18.6.0/bin/npm view wildcard@2.0.0
wildcard@2.0.0 | MIT | deps: none | versions: 10
Wildcard matching tools
https://github.com/DamonOehlman/wildcard#readme
keywords: string, wildcard
dist
.tarball: https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz
.shasum: a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec
.integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==
.unpackedSize: 21.7 kB
maintainers:
- damonoehlman <damon.oehlman@sidelab.com>
dist-tags:
latest: 2.0.0
published over a year ago by damonoehlman <damon.oehlman@gmail.com>

我通过我们的Nexus下载了那个软件包后查看了sha512(https://nexus.local/repository/npm-registry/wildcard/-/wildcard-2.0.0.tgz)使用命令CCD_ 6并返回CCD_。我不知道为什么sha512在通过本地Nexus下载包的过程中被更改了。

我试图使Nexus代理回购配置中的缓存无效。还检查了配置视图中的一些选项。

问题是由Apache代理配置引起的。选项AddEncoding不得包含.tgz值。

最新更新