• 请不要在回答技术问题时复制粘贴 AI 生成的内容
notot
V2EX  ›  程序员

感觉我的 bun 安装依赖越来越慢了,有大佬知道什么原因吗

  •  1
     
  •   notot · Jul 6, 2025 · 3212 views
    This topic created in 312 days ago, the information mentioned may be changed or developed.

    我用 better-t-stack@lates 。初始化一个项目,居然花了 14 分钟左右

    ◆ You can reproduce this setup with the following command: │ bun create better-t-stack@latest xscan --frontend next --backend hono --runtime bun --database sqlite --orm prisma --api trpc --auth --addons turborepo --examples none --db-setup none --web-deploy workers --git --package-manager bun --install │ └ Project created successfully in 861.51 seconds!

    然后我切换到 pnpm 花了 1 分多接近 2 分钟

    ◆ You can reproduce this setup with the following command: │ pnpm create better-t-stack@latest pnpm-test --frontend next --backend hono --runtime bun --database sqlite --orm prisma --api trpc --auth --addons turborepo --examples none --db-setup none --web-deploy workers --git --package-manager pnpm --install │ └ Project created successfully in 110.92 seconds!

    虽然 pnpm 我觉得也比较慢,但是相比 bun 好太多了。

    我记得 bun 刚发布 1.0 的时候 超级快的,现在不知道怎么了 慢得离谱

    7 replies    2025-07-07 11:08:53 +08:00
    Chaidu
        1
    Chaidu  
       Jul 6, 2025   ❤️ 4
    电脑端的浏览器 换来换去,最后都会回到 Google Chrome
    Node.js 的包管理器 换来换去,最后都会回到 pnpm
    mogita
        2
    mogita  
       Jul 6, 2025 via iPad
    包管理可能有网络因素?
    Anyway 现在我用 bun 当运行时是主要目的,大小项目能无缝替换成 bun 的越来越多了。
    qilme
        3
    qilme  
       Jul 6, 2025
    网络问题
    bun 无缓存:
    real 0m33.305s
    user 0m7.673s
    sys 0m6.248s
    bun 有缓存:
    real 0m4.817s
    user 0m2.403s
    sys 0m1.642s
    pnpm 无缓存:
    real 0m45.457s
    user 0m39.413s
    sys 0m23.434s
    pnpm 有缓存:
    real 0m34.143s
    user 0m14.724s
    sys 0m10.838s
    Hanggi
        4
    Hanggi  
       Jul 6, 2025
    @Chaidu 最终都会回到 yarn 吧
    jqtmviyu
        5
    jqtmviyu  
       Jul 6, 2025   ❤️ 1
    @Hanggi #4 自从有了 pnpm 硬链接, 体验提升太多, 新项目都很少见到 yarn 了. 我最近把 bun 当成 npm 全局包管理工具, 切 node 环境也不影响, 安装也不需要提权.
    CHTuring
        6
    CHTuring  
       Jul 7, 2025
    @jqtmviyu #5 你这个倒是提醒了我,可以把 bun 当成全局包的管理工具
    user1284
        7
    user1284  
       Jul 7, 2025
    zig 不行, bun 之前还想搞硬链接我就知道这东西开发者脑子有包的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1345 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 17:11 · PVG 01:11 · LAX 10:11 · JFK 13:11
    ♥ Do have faith in what you're doing.