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

When a URL is used for packageManager field of package.json, an error is thrown ("expected to match regular expression") #9611

Closed
1 task done
pkerschbaum opened this issue Dec 12, 2024 · 1 comment · Fixed by #9624
Labels
good first issue Good for newcomers kind: bug Something isn't working

Comments

@pkerschbaum
Copy link
Contributor

pkerschbaum commented Dec 12, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://codesandbox.io/p/devbox/https-github-com-inversify-inversifyjs-issues-1630-forked-mk4dgv?workspaceId=ws_UGoaic2rUkCT9cicv4uPWU

Which canary version will you have in your reproduction?

2.3.4-canary.2

Enviroment information

turbo 2.3.4-canary.2

CLI:
   Version: 2.3.4-canary.2
   Path to executable: /project/workspace/node_modules/.pnpm/turbo-linux-64@2.3.4-canary.2/node_modules/turbo-linux-64/bin/turbo
   Daemon status: Running
   Package manager: pnpm

Platform:
   Architecture: x86_64
   Operating system: linux
   WSL: false
   Available memory (MB): 3018
   Available CPU cores: 2

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): unknown
   Terminal program version (TERM_PROGRAM_VERSION): unknown
   Shell (SHELL): /bin/bash
   stdin: false

Expected behavior

turbo run should work.

Actual behavior

turbo run throws an error:

➜  workspace git:(master) ✗ COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 pnpm exec turbo run build
turbo 2.3.4-canary.2

invalid_package_manager_field

  × could not parse the packageManager field in package.json, expected to match regular expression (?P<manager>bun|npm|pnpm|yarn)@(?P<version>\d+\.\d+\.\d+(-.+)?)
   ╭─[/project/workspace/package.json:6:1]
 6 │   },
 7 │   "packageManager": "pnpm@https://registry.npmjs.org/@pkerschbaum/pnpm/-/pnpm-9.9.0-pkerschbaum-extensions-1.tgz",
   ·                     ──────────────────────────────────────────────┬──────────────────────────────────────────────
   ·                                                                   ╰── invalid `packageManager` field
 8 │   "dependencies": {
   ╰────

To Reproduce

  1. Open https://codesandbox.io/p/devbox/https-github-com-inversify-inversifyjs-issues-1630-forked-mk4dgv?workspaceId=ws_UGoaic2rUkCT9cicv4uPWU

  2. Run:

    corepack enable
    COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 pnpm install
    COREPACK_ENABLE_UNSAFE_CUSTOM_URLS=1 pnpm exec turbo run build

Additional context

@pkerschbaum pkerschbaum added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Dec 12, 2024
@anthonyshew anthonyshew added good first issue Good for newcomers and removed needs: triage New issues get this label. Remove it after triage labels Dec 12, 2024
@anthonyshew
Copy link
Contributor

Today, I learned Corepack can do that. I'm going to mark this with the good-first-issue label for right now as this is a relatively low lift - but a good get! You've also identified the exact line of code needed for the change. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants