Skip to content

Unable to read when using pnpm v9 #783

@mtgto

Description

@mtgto

Hi, I'm using licensed v5.0.1.
I found licensed cache returns an error in my project when I use pnpm v9.14.4.

licensed cache --sources pnpm
Caching dependency records for hugill
  pnpm
    Error @tauri-apps/api@ ()
    Error @tauri-apps/plugin-shell@ ()
    Error @tauri-apps/plugin-store@ ()
    Error bulma@ ()

  * Errors:
    * hugill.pnpm.@tauri-apps/api@
      - dependency path not found

    * hugill.pnpm.@tauri-apps/plugin-shell@
      - dependency path not found

    * hugill.pnpm.@tauri-apps/plugin-store@
      - dependency path not found

    * hugill.pnpm.bulma@
      - dependency path not found

Caching dependency records for src-tauri
  cargo

  * Warnings:
    * src-tauri.cargo
      - skipped source

  * 0 cargo dependencieslicensed --version
5.0.1pnpm --version
9.14.4

I found the error reason by reading pnpm.rb.
https://github.com/github/licensed/blob/v5.0.1/lib/licensed/sources/pnpm.rb#L22

pnpm.rb expects pnpm license list --json --long returns packages which contains "version" key, but pnpm v9 returns "versions" key.

pnpm licenses list prints license information of all versions of the same package in case different versions use different licenses. The format of the pnpm licenses list --json output has been changed pnpm/pnpm#7528.
https://github.com/pnpm/pnpm/releases/tag/v9.0.0

pnpm licenses list --json --long formats in pnpm v9.14.4

{
  "Apache-2.0": [
    {
      "name": "@ampproject/remapping",
      "versions": [
        "2.3.0"
      ],
      "paths": [
        "/Users/user/work/js/hugill/node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping"
      ],
      "license": "Apache-2.0",
      "author": "Justin Ridgewell",
      "homepage": "https://github.com/ampproject/remapping#readme",
      "description": "Remap sequential sourcemaps through transformations to point at the original source code"
    },
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions