# Discourse 包在 nix-shell 中构建失败

**URL:** <https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [2026年八月17日 10:25 UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198 "2026-08-17T10:25:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![ducks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ducks/32/518975_2.png) [@ducks](https://meta.discourse.org/u/ducks)\
**Post date:** [2026年八月17日 22:30 UTC](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198/10 "2026-08-17T22:30:16Z")

</div>

感谢反馈！我查看了一下，这似乎是 Nix 包中的 pnpm 版本不匹配问题，而不是依赖项哈希（dependency hash）的问题。

Discourse `v2026.1.4` 声明使用 `pnpm@10.28.0`，而 [Nix 表达式](https://github.com/NixOS/nixpkgs/blob/nixos-26.05/pkgs/servers/web-apps/discourse/default.nix#L42) 使用的是动态变化的 `pnpm_10` 包，该包目前解析为 `10.34.4`。这个较新的 pnpm 版本拒绝了该 Discourse 版本所使用的某些依赖项别名（dependency aliases）。

Nixpkgs 中可能的修复方案是将该派生包（derivation）固定到一个较旧的兼容 pnpm 版本，例如现有的 `pnpm_10_29_2` 包，或者精确指定为 `10.28.0`，并在必要时更新 `pnpmDeps.hash`。

由于 Nix 包是由社区维护的，因此需要在 Nixpkgs 中进行此修复，但希望这能为维护者指明正确的方向。

---

_[View the full topic](https://meta.discourse.org/t/discourse-package-fails-to-build-through-nix-shell/410198)._
