CLI 命令管理依赖项pnpm pruneVersion: NextOn this pagepnpm prune删除不需要的软件包。 参数 --prod 删除在 devDependencies 中列出的软件包。 --no-optional 删除在 optionalDependencies 中列出的软件包。 warningprune 命令目前不支持在单体仓库(monorepo)中递归执行。如果需要在单体仓库(monorepo)下的 node_modules 文件夹中只安装针对生产环境(production)的依赖包的话,可以先删除 node_modules 文件夹,然后使用 pnpm install --prod 命令重新安装。