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

package.json resolutions entry breaks pnpm #12262

Open
braco opened this issue Jan 4, 2024 · 4 comments
Open

package.json resolutions entry breaks pnpm #12262

braco opened this issue Jan 4, 2024 · 4 comments

Comments

@braco
Copy link

braco commented Jan 4, 2024

https://github.com/NodeBB/NodeBB/blob/b6dbe1a6d68d9ea0fd9ee9681b2955a2efc2523c/install/package.json#L177C1-L179

3.813  ERR_PNPM_INVALID_OVERRIDES_SELECTOR  Cannot parse the "*/jquery" selector in pnpm.overrides

It seems like resolutions is yarn only, and npm's equivalent is overrides?

and I think the point of that entry is to make sure all dependencies have the same version of jquery, but I believe this is covered by just using "jquery", which would be more compatibile.

@julianlam
Copy link
Member

The directive was added purely to fix an issue on yarn where the wrong jQuery plugin versions were installed. I think that's why it's */jquery.

If pnpm doesn't crash, that's fine. It probably installs the proper versions like npm does.

@julianlam
Copy link
Member

I'm not entirely sure if we still need that directive, so it's worth checking on yarn to see.

@julianlam
Copy link
Member

See #10877

@braco
Copy link
Author

braco commented Jan 4, 2024

Ahh thanks.

It causes pnpm initialization to abort.

 > [nodebb builder 6/9] RUN corepack use pnpm@*:                                                                                                                                                              
1.264 Installing pnpm@8.14.0 in the project...
2.355 
3.813  ERR_PNPM_INVALID_OVERRIDES_SELECTOR  Cannot parse the "*/jquery" selector in pnpm.overrides
------
failed to solve: process "/bin/sh -c corepack use pnpm@*" did not complete successfully: exit code: 1
(base) 

If I remember correctly, "*/jquery" is equivalent to "jquery", so wondering if that specific format is necessary. I just looked, the documentation around that isn't very good. I believe the globs were there to cover sub packages with parents like "foo/**/bar"

For now I'm removing the entry from package.json so build works:
jq 'del(.resolutions)' package.json | sponge package.json

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

2 participants