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

[regression] pnpm: /@(-.-)/env@0.3.1(zod@3.21.4) is an invalid relative dependency path #6348

Closed
dtinth opened this issue Apr 3, 2023 · 0 comments · Fixed by #6349
Closed
Assignees

Comments

@dtinth
Copy link

dtinth commented Apr 3, 2023

pnpm version:

8.1.0

Code to reproduce the issue:

echo '{"dependencies":{"@(-.-)/env":"^0.3.1","zod":"^3.21.4"}}' > package.json
pnpm i # First invocation, installation works fine
pnpm i # Second invocation, installation fails

Expected behavior:

It should work.

Notes:

  • ( and ) characters are valid characters in npm usernames, therefore @(-.-) is a valid npm scope.
  • This problem does not happen in pnpm v7.x. Maybe this has something to do with the new lockfile format.

Actual behavior:

$ pnpm i                                                                                 (base)
Lockfile is up to date, resolution step is skipped
 WARN  Broken lockfile: no entry for '/@(-.-)/env/0.3.1(zod@3.21.4)' in pnpm-lock.yaml
 ERR_PNPM_ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  The lockfile is broken! Resolution step will be performed to fix it.
 ERROR  /@(-.-)/env@0.3.1(zod@3.21.4) is an invalid relative dependency path

pnpm: /@(-.-)/env@0.3.1(zod@3.21.4) is an invalid relative dependency path
    at Object.parse2 [as parse] (/snapshot/dist/pnpm.cjs)
    at nameVerFromPkgSnapshot (/snapshot/dist/pnpm.cjs)
    at addPreferredVersionsFromLockfile (/snapshot/dist/pnpm.cjs)
    at getPreferredVersionsFromLockfileAndManifests (/snapshot/dist/pnpm.cjs)
    at _installInContext (/snapshot/dist/pnpm.cjs)
    at async installInContext (/snapshot/dist/pnpm.cjs)
    at async _install (/snapshot/dist/pnpm.cjs)
    at async mutateModules (/snapshot/dist/pnpm.cjs)
    at async install (/snapshot/dist/pnpm.cjs)
    at async installDeps (/snapshot/dist/pnpm.cjs)

Additional information:

  • node -v prints: v18.13.0
  • Windows, macOS, or Linux?: macOS
@dtinth dtinth changed the title pnpm: /@(-.-)/env@0.3.1(zod@3.21.4) is an invalid relative dependency path [regression] pnpm: /@(-.-)/env@0.3.1(zod@3.21.4) is an invalid relative dependency path Apr 3, 2023
@zkochan zkochan self-assigned this Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants