bun-install

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/bun:install

/bun:install

Install all dependencies from package.json using Bun.
使用Bun安装package.json中的所有依赖。

Context

上下文

Package file: `find . -maxdepth 1 -name "package.json" | head -1`
Lock file: `find . -maxdepth 1 -name "bun.lock*" -o -name "bun.lockb" | head -1`
Package file: `find . -maxdepth 1 -name "package.json" | head -1`
Lock file: `find . -maxdepth 1 -name "bun.lock*" -o -name "bun.lockb" | head -1`

Execution

执行步骤

  1. Check if package.json exists
  2. Run installation with appropriate flags:
Development (default):
bash
bun install
CI/Reproducible builds:
bash
bun install --frozen-lockfile
Production deployment:
bash
bun install --production
  1. Report installed package count and any warnings
  1. 检查package.json是否存在
  2. 使用合适的参数运行安装命令:
开发环境(默认):
bash
bun install
CI/可复现构建:
bash
bun install --frozen-lockfile
生产部署:
bash
bun install --production
  1. 报告已安装的包数量及任何警告

Post-install

安装后操作

  • Verify node_modules exists
  • Check for peer dependency warnings
  • Run
    bun run prepare
    if it exists (for husky/hooks)
  • 验证node_modules是否存在
  • 检查peer dependency警告
  • 如果存在
    bun run prepare
    命令则执行(用于husky/hooks)