vercel-deploy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vercel Deploy

Vercel 部署

Deploy any project to Vercel instantly. Always deploy as preview (not production) unless the user explicitly asks for production.
将任意项目即时部署到Vercel。默认始终部署为预览版本(而非生产版本),除非用户明确要求生产部署。

Prerequisites

前提条件

  • When sandboxing blocks the deployment network calls, rerun with
    sandbox_permissions=require_escalated
    .
  • The deployment might take a few minutes. Use appropriate timeout values.
  • 当沙箱环境阻止部署网络调用时,使用
    sandbox_permissions=require_escalated
    重新运行部署命令。
  • 部署可能需要几分钟时间,请设置合适的超时值。

Quick Start

快速开始

Just run this (with a 10 minute timeout):
bash
vercel deploy [path] -y
Important: Use a 10 minute (600000ms) timeout for the deploy command since builds can take a while.
If that fails with "No existing credentials found", use the fallback method below.
只需运行以下命令(设置10分钟超时):
bash
vercel deploy [path] -y
重要提示: 部署命令需设置10分钟(600000毫秒)的超时时间,因为构建过程可能耗时较长。
如果命令执行失败并提示“No existing credentials found”,请使用下方的备用方法。

Fallback (No Auth)

备用方案(无身份验证)

If CLI fails with auth error, use the deploy script:
bash
undefined
如果CLI因身份验证错误失败,请使用部署脚本:
bash
undefined

Deploy current directory

部署当前目录

bash scripts/deploy.sh
bash scripts/deploy.sh

Deploy specific project

部署指定项目

bash scripts/deploy.sh /path/to/project
bash scripts/deploy.sh /path/to/project

Deploy existing tarball

部署现有压缩包

bash scripts/deploy.sh /path/to/project.tgz

The script handles framework detection, packaging, and deployment. It waits for the build to complete and returns JSON with `previewUrl` and `claimUrl`.

**Tell the user:** "Your deployment is ready at [previewUrl]. Claim it at [claimUrl] to manage your deployment."
bash scripts/deploy.sh /path/to/project.tgz

该脚本会自动处理框架检测、打包和部署。它会等待构建完成,并返回包含`previewUrl`和`claimUrl`的JSON数据。

**告知用户:**“你的部署已完成,访问地址为[previewUrl]。请通过[claimUrl]认领部署以进行管理。”

Production Deploys

生产环境部署

Only if user explicitly asks:
bash
vercel deploy [path] --prod -y
仅当用户明确要求时使用:
bash
vercel deploy [path] --prod -y

Output

输出结果

Show the user the deployment URL. For fallback deployments, also show the claim URL.
Do not curl or fetch the deployed URL to verify it works. Just return the link.
向用户展示部署URL。对于使用备用方案的部署,还需展示认领URL。
请勿通过curl或fetch请求已部署的URL来验证其可用性,直接返回链接即可。

Troubleshooting

故障排除

Escalated Network Access

提升网络权限

If deployment fails due to network issues (timeouts, DNS errors, connection resets), rerun the deploy with escalated permissions (use
sandbox_permissions=require_escalated
). The deploy requires escalated network access when sandbox networking blocks outbound requests.
Example guidance to the user:
The deploy needs escalated network access to deploy to Vercel. I can rerun the command with escalated permissions—want me to proceed?
如果部署因网络问题失败(超时、DNS错误、连接重置),请使用提升的权限重新运行部署命令(添加
sandbox_permissions=require_escalated
)。当沙箱网络阻止出站请求时,部署需要提升的网络权限。
给用户的示例指引:
部署到Vercel需要提升网络权限。我可以使用提升的权限重新运行命令——是否继续?