Innei / Shiro

📜 A minimalist personal website embodying the purity of paper and freshness of snow.
https://innei.in
Other
3.28k stars 697 forks source link

Dependency Conflict: kbar and react #379

Closed yaner-here closed 3 months ago

yaner-here commented 3 months ago

Describe the bug

PS C:\Shiro> pnpm install caniuse-lite
 WARN  2 deprecated subdependencies found: glob@7.2.3, inflight@1.0.6
Already up to date
Progress: resolved 945, reused 925, downloaded 0, added 0, done
 WARN  Issues with peer dependencies found
.
└─┬ kbar 0.1.0-beta.45
  └─┬ react-virtual 2.10.4
    └── ✕ unmet peer react@"^16.6.3 || ^17.0.0": found 18.3.1

Versions of kbar and react are hardcoded in package.json. https://github.com/Innei/Shiro/blob/653cac2ee21b7ddb9f9fdc4ab1c4d53cb511db4e/package.json#L96 https://github.com/Innei/Shiro/blob/653cac2ee21b7ddb9f9fdc4ab1c4d53cb511db4e/package.json#L111

Reproduction

pnpm install

System Info

PS C:\Shiro> npx envinfo --system --binaries --browsers
Need to install the following packages:
envinfo@7.13.0
Ok to proceed? (y) y

  System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 33.55 GB / 63.77 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.12.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Internet Explorer: 11.0.19041.1566

Used Package Manager

pnpm

Validations

TNXG commented 3 months ago

部署大型Node项目的时候记得避开Windows,或许Mac或者Linux是不错的选择。

大規模なNodeプロジェクトをデプロイする際には、Windowsを避けてください。MacまたはLinuxが良い選択かもしれません。

When deploying a large Node project, be sure to avoid Windows. Mac or Linux might be a better choice.

yaner-here commented 3 months ago

@TNXG Thanks for replying. I created a new Github Codespace and everything worked, which exceeds my expectations. After inspecting the pnpm lockfile, I believe that there's a potential conflict indeed, but for some reason, it won't lead to error in some specific environments. https://github.com/Innei/Shiro/blob/653cac2ee21b7ddb9f9fdc4ab1c4d53cb511db4e/pnpm-lock.yaml#L236-L238 https://github.com/Innei/Shiro/blob/653cac2ee21b7ddb9f9fdc4ab1c4d53cb511db4e/pnpm-lock.yaml#L4085-L4088 After upgrading my pnpm, the problem has gone. Perhaps higher version of pnpm doesn't follow peer dependencies very strictly? Who knows ㄟ( ▔, ▔ )ㄏ

PS C:\> pnpm --version
8.12.0

PS C:\> npm install pnpm -g
changed 1 package in 3s

PS C:\> pnpm --version
9.2.0