diff --git a/README.md b/README.md index a0b6c0e..68fb02f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,18 @@ pnpm build **方式 A:安装包(推荐,免装 Node.js)** -1. 在控制端构建安装包:`pnpm pack:win`(产物:`release/nodeagent-win-x64.zip`) +1. 在控制端构建安装包(**需在项目目录执行**): + + ```bash + cd <项目目录> # 例如 ~/WorkBuddy/NodeAgent/nodeagent + pnpm pack:win + + # 或从任意目录调用: + node <项目目录>/scripts/pack.mjs + ``` + + 产物:`release/nodeagent-win-x64.zip`(约 32MB) + 2. 把 zip 拷到 Windows 并解压 3. 右键以**管理员**运行其中的 `install.ps1` diff --git a/scripts/pack.mjs b/scripts/pack.mjs index a568779..5a26676 100644 --- a/scripts/pack.mjs +++ b/scripts/pack.mjs @@ -68,7 +68,8 @@ async function main() { execFileSync( esbuild, [ - 'apps/agent/dist/index.js', + // 输入用绝对路径,保证从任意工作目录调用都能解析 + join(root, 'apps', 'agent', 'dist', 'index.js'), '--bundle', '--platform=node', '--target=node22',