You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Debian/Ubuntu安装PNPM包管理器遇报错,求解决方法

解决Debian/Ubuntu安装PNPM时的命令错误

错误原因分析

  • bash: sh-: command not found:命令里误写了sh-,多了一个多余的减号,系统无法识别这个不存在的命令。
  • (23) Failed writing body:由于管道后无有效命令接收curl的输出,导致内容写入失败。

正确安装命令

修正命令中的错误,执行以下任意一条即可:

  • 使用sh执行安装脚本:
    curl -fsSL https://get.pnpm.io/install.sh | sh
    
  • 或者用bash执行:
    curl -fsSL https://get.pnpm.io/install.sh | bash
    

可选的分步验证方案

如果上述命令仍有问题,可以拆分步骤操作,排除网络或管道异常:

  1. 单独下载安装脚本:
    curl -fsSL https://get.pnpm.io/install.sh -o install-pnpm.sh
    
  2. 给脚本添加执行权限:
    chmod +x install-pnpm.sh
    
  3. 运行脚本完成安装:
    ./install-pnpm.sh
    

内容的提问来源于stack exchange,提问作者user20179334

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 15:30:53