Skip to content

feat/node: pnpm store v11 support#537

Merged
bbhtt merged 5 commits into
flatpak:masterfrom
YUCLing:feat/pnpm-store-v11
May 19, 2026
Merged

feat/node: pnpm store v11 support#537
bbhtt merged 5 commits into
flatpak:masterfrom
YUCLing:feat/pnpm-store-v11

Conversation

@YUCLing

@YUCLing YUCLing commented May 12, 2026

Copy link
Copy Markdown
Contributor

I've only tested with my project's lockfile, works as intended.

close #535

@YUCLing YUCLing requested a review from a team as a code owner May 12, 2026 00:51
@github-actions github-actions Bot added the node label May 12, 2026
Comment thread node/flatpak_node_generator/providers/pnpm.py
Comment thread node/flatpak_node_generator/populate_pnpm_store.py Outdated
Comment thread node/flatpak_node_generator/main.py Outdated
Comment thread node/pyproject.toml Outdated
Comment thread node/flatpak_node_generator/populate_pnpm_store.py
Comment thread node/flatpak_node_generator/populate_pnpm_store.py Outdated
Comment thread node/flatpak_node_generator/populate_pnpm_store.py Outdated
Comment thread node/tests/test_populate_pnpm_store.py
Comment thread node/tests/test_populate_pnpm_store.py Outdated
@bbhtt

bbhtt commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Adding some integration tests using v11 would be nice.

Also ccing @nukeop @andersk if they want to test / review since you tested last time.

Comment thread node/flatpak_node_generator/populate_pnpm_store.py
@nukeop

nukeop commented May 13, 2026

Copy link
Copy Markdown
Contributor

I just tested this with Nuclear (nukeop/nuclear), pnpm 11.0.6, lockfile v9.

The store gets populated (index.db is created, pnpm install --offline gets past resolution), but pnpm fails when it tries to extract packages from the store:

Running: pnpm install --offline --frozen-lockfile
Scope: all 14 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1103
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[ERR_PNPM_NO_OFFLINE_TARBALL] A package is missing from the store but cannot download it in offline mode. The missing package may be downloaded from https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.7.1.tgz.

That's the first package alphabetically, so it's not finding any packages at all. The index lookup seems to succeed (it gets past resolution and starts linking), but the files in v11/files/ aren't matching what pnpm expects.

References:

Let me know if I can help with debugging in any way.

@YUCLing

YUCLing commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@nukeop Thanks for testing!

That's the first package alphabetically, so it's not finding any packages at all.

Not really, pnpm is using workers to look up indexes and read package information, so it depends on which worker fails first.

The index lookup seems to succeed (it gets past resolution and starts linking), but the files in v11/files/ aren't matching what pnpm expects.

Actually it can also be pnpm fails to find the entry it needs from index, but it doesn't tell you what's exactly wrong. I will look into it to find out what's actually wrong.

@YUCLing

YUCLing commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@nukeop Hi there! I just pinned down the issue you encountered! It's not that store is not working, actually, it's working perfectly well!

The problem is that pnpm v11 no longer reads store-dir from .npmrc, thus it's not using the store at all. You can now workaround by using pnpm's --store-dir argument

Example
sh-5.2$ pnpm install --offline --frozen-lockfile --store-dir /home/rain/projects/nuclear-music-player-fp/nuclear/flatpak/.flatpak-builder/build/nuclear-music-player-1/flatpak-node/pnpm-store
Scope: all 14 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1103
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1103, reused 1097, downloaded 0, added 1103, done

devDependencies:
+ @ianvs/prettier-plugin-sort-imports 4.7.1
+ @tailwindcss/vite 4.2.4
+ @vitejs/plugin-react 5.2.0
+ @vitest/coverage-v8 4.1.5
+ eslint 10.3.0
+ husky 9.1.7
+ jsdom 26.1.0
+ lint-staged 16.4.0
+ prettier-plugin-astro 0.14.1
+ prettier-plugin-tailwindcss 0.8.0
+ tailwindcss 4.2.4
+ turbo 2.9.7
+ typescript 5.9.3
+ vite 7.3.3
+ vite-plugin-dts 4.5.4
+ vite-plugin-svgr 4.5.0
+ vitest 4.1.5

. prepare$ husky
└─ Done in 66ms
Done in 3.9s using pnpm v11.0.6

Had some free space issues, so most files are moved by pnpm already, that's why it appears to be finished fast

@nukeop

nukeop commented May 13, 2026

Copy link
Copy Markdown
Contributor

You were right, with the correction you suggested the build passes just fine.

https://github.com/nukeop/nuclear/actions/runs/25802919961/job/75797639120

@YUCLing YUCLing force-pushed the feat/pnpm-store-v11 branch 3 times, most recently from 38cd2e5 to b001ab4 Compare May 18, 2026 04:51
@YUCLing YUCLing force-pushed the feat/pnpm-store-v11 branch from b001ab4 to 4dcceeb Compare May 18, 2026 05:05
@YUCLing YUCLing requested a review from bbhtt May 18, 2026 05:05
Comment thread node/flatpak_node_generator/populate_pnpm_store.py Outdated
Comment thread node/flatpak_node_generator/providers/pnpm.py
Comment thread node/tests/test_populate_pnpm_store.py
@bbhtt bbhtt merged commit ee65dc7 into flatpak:master May 19, 2026
4 checks passed
@YUCLing YUCLing deleted the feat/pnpm-store-v11 branch May 27, 2026 13:23
Comment thread node/flatpak_node_generator/providers/pnpm.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for pnpm store v11

4 participants