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

Proto misparses version emitted by corepack #231

Closed
rotu opened this issue Oct 11, 2023 · 5 comments · Fixed by moonrepo/node-plugin#10
Closed

Proto misparses version emitted by corepack #231

rotu opened this issue Oct 11, 2023 · 5 comments · Fixed by moonrepo/node-plugin#10
Assignees
Labels
bug Something isn't working

Comments

@rotu
Copy link
Contributor

rotu commented Oct 11, 2023

What version?

0.19.3

Which command?

npm

What happened?

corepack suggests embedding a hash in the package.json#packageManager field https://github.com/nodejs/corepack/blob/2533d128872b9a42318d841718e635b29c761a96/README.md?plain=1#L68-L82 and currently writes this when you do corepack use npm or corepack up.

When running the npm shim, proto chokes on this format:

Error: proto::version::unresolved

× Failed to resolve a semantic version for
│ 10.2.0+sha256.c362077587b1e782e5aef3dcf85826399ae5
│ 52ad66b760e2585c4ac11102243f.

Note that npm ignores the build metadata (anything after +), per npm/cli#1479

Any logs?

No response

Operating system?

Windows

Architecture?

x64

@milesj
Copy link
Contributor

milesj commented Oct 11, 2023

Interesting, this must be new? I don't remember corepack doing this in the past. Or maybe it's just a bug.

Should be an easy fix but I'll wait to see what the node.js team has to say.

@rotu
Copy link
Contributor Author

rotu commented Oct 11, 2023

Definitely intentional https://github.com/nodejs/corepack/blob/0b7abb9833d332bad97902260d31652482c274a0/README.md#when-authoring-packages but relatively new. The format was introduced on purpose in nodejs/corepack#133 but corepack only started creating these version strings in 0.20 nodejs/corepack#291.

I'm of the opinion that it's an abuse of semver, but that this needs to be supported anyway for corepack compatibility.

@milesj
Copy link
Contributor

milesj commented Oct 11, 2023

Sounds good, easy enough to fix.

@milesj
Copy link
Contributor

milesj commented Oct 11, 2023

Fix here moonrepo/node-plugin#10

@milesj
Copy link
Contributor

milesj commented Oct 12, 2023

Released a new plugin. You can delete the downloaded ~/.proto/plugins and try this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants