# @bugsplat/symbol-upload 中文文档

规范地址：https://npmcn.com/package/%40bugsplat/symbol-upload/

版本：11\.1\.0
npm 元数据更新时间：2026-11-02T15:08:23.462Z
中文译文更新时间：2026-11-08T19:07:37.025Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bugsplat/symbol-upload
原文对照：https://npmcn.com/package/%40bugsplat/symbol-upload/?lang=original
项目主页：https://github.com/BugSplat-Git/symbol-upload#readme
源码仓库：https://github.com/BugSplat-Git/symbol-upload

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：105 kB，54 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- Node.js 要求：^22\.23\.4 \|\| ^24\.22\.1 \|\| \>=26\.12\.1
- 运行依赖：13 个
- 首次发布：2021-03-28T20:41:11.587Z
- 最新版本发布：2026-11-02T15:08:22.960Z
- 近 30 天下载量：4468（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：72（近 12 个月 11 个）

## 中文简介

跨平台符号上传工具

## 安装

```sh
npm install @bugsplat/symbol-upload
```

也可以使用：`pnpm add @bugsplat/symbol-upload`、`yarn add @bugsplat/symbol-upload`、`bun add @bugsplat/symbol-upload`

## README

[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com/)  

# 

BugSpla

### **

为繁忙的开发者构建了崩溃和错误报告 .

**

 [![Follow @bugsplatco on Twitter](https://img.shields.io/twitter/follow/bugsplatco?label=Follow%20BugSplat&style=social)](https://twitter.com/BugSplatCo)[![Join BugSplat on Discord](https://img.shields.io/discord/664965194799251487?label=Join%20Discord&logo=Discord&style=social)](https://discord.gg/bugsplat)

  

# 符号上载

此 repo 是一个简单的 Node.js 工具, 一组库, 和 GitHub 动作, 用于上传符号文件或源地图到 [BugSpla](https://www.bugsplat.com/)。这个工具被设计为用于您的构建进程,用于将每个生产构建的符号自动上传到 BugSplate 。 此软件包可用作库或命令行工具.

## 行动

使用 `symbol-upload` 您的动作 [GitHub 动作](https://github.com/features/actions) 通过修改以下片段来修改工作流程 .

```yml
- name: Symbols 📦
  uses: BugSplat-Git/symbol-upload@v11
  with:
    clientId: "${{ secrets.SYMBOL_UPLOAD_CLIENT_ID }}"
    clientSecret: "${{ secrets.SYMBOL_UPLOAD_CLIENT_SECRET }}"
    database: "${{ secrets.BUGSPLAT_DATABASE }}"
    application: "your-application"
    version: "your-version"
    files: "**/*.{pdb,exe,dll}"
    directory: "your-build-directory"
    node-version: "24"
    dumpSyms: false
```

请务必使用 [隐藏](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) 以免你暴露价值 `clientId`, (中文(简体) ), `clientSecret`,以及 `database`。 。 。 .

键 `@v11` 跟踪最新11.x发布,或精确的标签,如 `@v11.0.0`。动作安装 `@bugsplat/symbol-upload` npm 包版本匹配被绑定的 ref; SHA 和分支 refs 安装该承诺所记录的版本 `package.json`设置 `symbol-upload-version` 以覆盖.

## 命令行

安装此 `symbol-upload` 全球使用 npm.

```bash
npm i -g @bugsplat/symbol-upload
```

或者,可以使用终端下载二进制版本.

马可

```sh
curl -sL -O "https://app.bugsplat.com/download/symbol-upload-macos" && chmod +x symbol-upload-macos
```

窗口

```ps1
Invoke-WebRequest -Uri "https://app.bugsplat.com/download/symbol-upload-windows.exe" -OutFile "symbol-upload-windows.exe"
```

链接

```sh
curl -sL -O  "https://app.bugsplat.com/download/symbol-upload-linux" && chmod +x symbol-upload-linux
```

运行 `symbol-upload` 与 `-h` 查看最新使用信息和软件包版本:

```bash
bobby@BugSplat % ~ % symbol-upload -h

@bugsplat/symbol-upload v10.5.2

  symbol-upload contains a command line utility and a set of libraries to help  
  you upload symbol files to BugSplat.                                          

Usage

  -h, --help                          Print this usage guide.                   
  -b, --database string               Your BugSplat database name. The value of 
                                      database must match the value used to     
                                      post crash reports. This value can also   
                                      be provided via the BUGSPLAT_DATABASE     
                                      environment variable.                     
  -a, --application string            The name of your application. If not      
                                      provided symbol-upload will attempt to    
                                      use the value of the name field in        
                                      package.json if it exists in the current  
                                      working directory.                        
  -v, --version string                Your application's version. If not        
                                      provided symbol-upload will attempt to    
                                      use the value of the version field in     
                                      package.json if it exists in the current  
                                      working directory.                        
  -i, --clientId string               An OAuth2 Client Credentials Client ID    
                                      for the specified database. If provided   
                                      --clientSecret must also be provided.     
                                      This value can also be provided via the   
                                      SYMBOL_UPLOAD_CLIENT_ID environment       
                                      variable.                                 
  -s, --clientSecret string           An OAuth2 Client Credentials Client       
                                      Secret for the specified database. If     
                                      provided --clientId must also be          
                                      provided. This value can also be provided 
                                      via the SYMBOL_UPLOAD_CLIENT_SECRET       
                                      environment variable.                     
  -r, --remove                        Removes symbols for a specified database, 
                                      application, and version. If this option  
                                      is provided no other actions are taken.   
  -f, --files string (optional)       Glob pattern that specifies a set of      
                                      files to upload. For example,             
                                      **/*.{pdb,exe,dll} will recursively       
                                      search for .pdb, .exe, and .dll files.    
                                      Defaults to "*.js.map"                    
  -d, --directory string (optional)   Path of the base directory used to search 
                                      for symbol files. This value will be      
                                      combined with the --files glob. Defaults  
                                      to '.'                                    
  -m, --dumpSyms boolean (optional)   Use dump_syms to generate and upload sym  
                                      files for specified binaries.             
  -l, --localPath string (optional)   Path to a directory to copy symbols to.   
                                      If provided, the files will be copied to  
                                      the provided path instead of being        
                                      uploaded to BugSplat. Useful for creating 
                                      a self-hosted symbol server.              

  The -i and -s arguments are not required if you set the environment variables 
  SYMBOL_UPLOAD_CLIENT_ID and SYMBOL_UPLOAD_CLIENT_SECRET.                      

Example

  symbol-upload -b your-bugsplat-database -a your-application-name -v your-     
  version -i your-client-id -s your-client-secret [ -f "*.js.map" -d            
  "/path/to/containing/dir" ]                                                   

Links

  🐛 https://bugsplat.com                          
                                                   
  💻 https://github.com/BugSplat-Git/symbol-upload 
                                                   
  💌 support@bugsplat.com
```

运行指定符号上载 [阴影](https://www.npmjs.com/package/glob#glob-primer) 模式 `-f` 和一条向前斜线的路径 `-d`。多个文件类型可以用逗号隔开的圆括号来指定,通配符可以用于循环搜索目录。 譬如说, `**/*.{pdb,exe,dll}` 将查找所有 `.pdb`, (中文(简体) ), `.exe`,以及 `.dll` 当前目录和所有子目录中的文件。 可选择指定 `-m` 要运行的旗帜 [丢弃( s)](https://github.com/BugSplat-Git/node-dump-syms) 针对指定的二进制并上传结果 `.sym` 文档.

### 自控符号服务器

符号加载工具可用于创建 [符号SymSrv](https://learn.microsoft.com/en-us/windows/win32/debug/symbol-servers-and-symbol-stores) 兼容 BugSplate 和 Windows 符号的目录结构 [微软视觉工作室](https://learn.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2022#configure-location-of-symbol-files-and-loading-options)此外,符号-上载还可以为macOS和Crashpad符号创建一个SymSrv目录结构,与BugSplatz兼容.

要将符号上传到本地目录,请提供 `-l` 旗帜和将复制符号的路径.

```bat
symbol-upload -f "**/*.{pdb,exe,dll}" -l "C:\path\to\output"
```

接下来,使用同步工具将目录上传到云服务供应商. 下面是使用 `s3 sync` 通过 [AWS CLI (英语)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)。 。 。 .

```bat
aws s3 sync . s3://your-bucket-name-here
```

要将 BugSplaet 连接到您自托管的符号服务器, 请参考我们的符号服务器 [文档](https://docs.bugsplat.com/introduction/development/working-with-symbol-files/symbol-servers)。 。 。 .

## API 密码

在本地安装此软件包

```bash
npm i @bugsplat/symbol-upload
```

### 模块兼容性

这个软件包既支持ES模块(ESM),也支持CommonJS(CJS)格式. 在任何一种环境中都可以使用:

**ES模块(ESM):**

```ts
import { OAuthClientCredentialsClient, uploadSymbolFiles } from '@bugsplat/symbol-upload';
```

**常见JS( CJS):**

```js
const { OAuthClientCredentialsClient, uploadSymbolFiles } = require('@bugsplat/symbol-upload');
```

导入 `OAuthClientCredentialsClient` 从 @ bugsplat/ symbol- upload 并用一个认证 [OAuth2 客户端证书](https://docs.bugsplat.com/introduction/development/web-services/oauth2#client-credentials) 客户身份和客户秘密.

创建新实例 `OAuthClientCredentialsClient` 使用 `createAuthenticatedClient` async 工厂功能 .

```ts
const bugsplat = await OAuthClientCredentialsClient.createAuthenticatedClient(clientId, clientSecret);
```

将符号文件上传到bugsplat 中,通过调用 `uploadSymbolFiles` 函数.

```ts
const directory = '/path/to/symbols/dir';
const files = ['my-cool-app.exe', 'my-cool-app.pdb'];
await uploadSymbolFiles(bugsplat, database, application, version, directory, files);
```

如果您所做的一切正确, 请单击应用程序链接时显示您的符号 [版本数](https://app.bugsplat.com/v2/versions) 页 次.

![image](https://github.com/BugSplat-Git/symbol-upload/assets/2646053/7314bd36-05db-4188-89e4-10f4e7442cec)

谢谢你用BugSplate!

## 常见问题

### @bugsplat/symbol-upload 是什么？

跨平台符号上传工具

### 如何安装 @bugsplat/symbol-upload？

在项目目录运行 npm install @bugsplat/symbol-upload，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 symbol-upload，可以用 npx symbol-upload 直接运行。

### @bugsplat/symbol-upload 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bugsplat/symbol-upload 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @bugsplat/symbol-upload 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js ^22\.23\.4 \|\| ^24\.22\.1 \|\| \>=26\.12\.1。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bugsplat/symbol-upload 可以商用吗？

@bugsplat/symbol-upload 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @bugsplat/symbol-upload 的下载量有多少？

根据 npm 官方下载统计，@bugsplat/symbol-upload 在 2026/10/09 – 2026/11/07 这 30 天内被下载 4,468 次，日均约 149 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bugsplat/symbol-upload 还在维护吗？

最新版本 11\.1\.0 发布于 2026/11/02（6 天前）；至今共发布 72 个版本，其中过去 12 个月发布了 11 个；首次发布于 2021/03/29。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

