Skip to content

fix(config): pnpm workspace #160

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

Fabious
Copy link
Contributor

@Fabious Fabious commented Jul 15, 2025

When trying to contribute, I can't pnpm install on a fresh clone:

 ERROR  packages field missing or empty

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

I've cloned the repo and ran pnpm install and I did not reproduce the error you mentioned.
And this error is strange as the current setup doesn't use the monorepo feature, (which the packages field is used for).
The pnpm-workspace.yaml in only there to allow the build script of some dependencies.

What is your version of pnpm?

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

My guess is that you are on an older pnpm version.
The error was reported there: pnpm/pnpm#9361 and there pnpm/pnpm#8968
And has been fixed in this PR: pnpm/pnpm#8969

The current package manager version is pnpm@10.13.1
You can try installing it with the corepack install command

@Fabious
Copy link
Contributor Author

Fabious commented Jul 15, 2025

Yes, I use pnpm@9, so the error comes from that.
Maybe we shouldn't restrict the version and be explicit in the config file with the "packages" field? I think it's better to explicitly reference the packages. Feel free to close this MR if it's not a good idea 😁

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

Did you see a message (warning) about your pnpm version when running the pnpm install command?

Another solution could be to enable the packagemanagerstrictversion option, it would prevent the error but it is much stricter.

@Fabious
Copy link
Contributor Author

Fabious commented Jul 15, 2025

Got only the line I pasted as error. Not really helpful ^^'

Restricting pnpm version too strictly could discourage people from contributing.

Maybe specify a range version. Or at the very least document the requirement for contributing in the readme.

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

Unfortunately we can't specify a version range.

Or at the very least document the requirement for contributing in the readme

I've create #161 for that but I think we can merge yours

Thanks 😉

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

@Fabious Can you fix the lockfile please?

@J3m5
Copy link
Contributor

J3m5 commented Jul 15, 2025

@J3m5 J3m5 merged commit ffe7b61 into api-platform:main Jul 16, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants