Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read when using pnpm v9 #783

Open
mtgto opened this issue Dec 30, 2024 · 0 comments
Open

Unable to read when using pnpm v9 #783

mtgto opened this issue Dec 30, 2024 · 0 comments

Comments

@mtgto
Copy link

mtgto commented Dec 30, 2024

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/@[email protected]/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"
    },
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant