Skip to content

Corepack breaks when integrity key is missing from metadata, from artifactory #537

Closed

Description

@trc-mathieu

Hi, I am actually using artifactory as npm proxy and it's missing the dist/integrity neither dist/signatures keys so this line breaks corepack since integrity is null.

build[1] = Buffer.from(integrity.slice(`sha512-`.length), `base64`).toString(`hex`);

I'm using corepack@v0.29.2

Would it be possible to fallback to dist/shasum in that case?

For instance, for corepack, I only have this

{
  "dist" : {
    "tarball" : "https://artifactory.<our domain>.com/artifactory/api/npm/npm/corepack/-/corepack-0.28.2.tgz",
    "shasum" : "2270c8fd1e4bebffda46ac0978d1f8b4202739ba"
  },
}

where npm has a lot more info

"dist": {
    "shasum": "2270c8fd1e4bebffda46ac0978d1f8b4202739ba",
    "tarball": "https://registry.npmjs.org/corepack/-/corepack-0.28.2.tgz",
    "fileCount": 54,
    "integrity": "sha512-YOo8PWW/SOQs7mqDIP6dDp9KoIyFvOJaoTofrXQEOIAZ5D24OpgKQ6JeW1HhXsRCMm1t1AunC/hXyqfT9G+5GQ==",
    "signatures": [
      {
        "sig": "MEQCIBBdptqO4kmk7aUSqWxmDQZ7O9acaxXdyHrFkM7P9jQPAiAINyseohZpq6pmY/Ufsw/XBgKcJy7buhcjDx5Icm9cjQ==",
        "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
      }
    ],
    "unpackedSize": 1030119
  },

const {version, dist: {integrity, signatures}} = metadata;

Activity

  1. aduh95 commented on Jul 18, 2024

    @aduh95
    Contributor

    What breaks Corepack? Can you be more specific? Like what command do you run and what error do you see?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions