Windows Esm Installer
v1.0.0自动修复 Windows 安装路径错误,配置 npm 国内镜像源,检测依赖并生成一键安装脚本及安装报告。
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The name/description (Windows ESM installer, npm mirror, path fixes, script generation) match the code and SKILL.md. The code performs Node/npm detection, sets npm registry to npmmirror, generates install scripts, and writes an INSTALL_REPORT.md—these are expected for an installer. Minor documentation/test mismatches exist (tests reference a Unix /tmp path and README mentions a scripts/ folder that isn't present in the package manifest), but these are quality issues, not malicious inconsistencies.
Instruction Scope
SKILL.md and code limit actions to diagnosing the environment, setting npm registry, generating .bat/.ps1 scripts, writing INSTALL_REPORT.md, and returning file paths. The runtime uses child_process to run safe-sounding system checks (node/npm/git/zstd) and runs npm commands. Note: invoking npm install is normal for an installer but will execute package install scripts from package.json—review generated scripts and run in a safe directory before executing.
Install Mechanism
There is no install spec (instruction-only skill plus source files). No downloads from arbitrary URLs or extraction operations are present. Dependencies listed are devDependencies for testing/build and come from npm (package-lock.json present) which is expected for a TypeScript skill.
Credentials
The skill declares no required environment variables or credentials and does not attempt to read unrelated config paths. The only external endpoint it configures is the npm mirror (https://registry.npmmirror.com), which is coherent with the stated goal of fixing npm timeouts. No secrets or cloud credentials are requested.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges. It writes files into the current working directory (install.bat, install.ps1, INSTALL_REPORT.md) and the scripts may require administrator privileges when run by the user—this is reasonable for installer tasks. The skill does not modify other skills or global agent configuration.
Assessment
This skill appears to do what it says: diagnose Node/npm, set an npm mirror, generate Windows install scripts, and write an INSTALL_REPORT.md. Before running: (1) review the generated install.bat/install.ps1 and INSTALL_REPORT.md to ensure they do what you expect; (2) run the skill from a safe/test project directory or a copy of your project (npm install will execute package install scripts and can run arbitrary code); (3) only grant administrator rights when you understand why they're needed; (4) note minor repository mismatches (tests use a /tmp path and README references a scripts/ folder) — these are likely quality issues but verify paths and outputs on your platform (this tool is Windows-focused).Like a lobster shell, security has layers — review code before you run it.
latest
🪟 windows-esm-installer - Windows 一键安装修复工具
🎯 功能
解决 Windows 用户安装 OpenClaw/Skill 时的常见问题。
核心功能
- 🔧 Windows 路径修复 - c:\path → file:///c:/path
- 🌏 npm 镜像源配置 - 自动设置淘宝镜像
- 📊 系统依赖检测 - Node.js/npm/系统组件
- 📝 一键安装脚本 - 生成.bat/.ps1 脚本
- 📄 安装报告生成 - 自动生成 INSTALL_REPORT.md
🚀 使用方法
命令触发
/win-fix
/install-fix
/windows-install
自然语言触发
Windows 安装
修复安装
ESM 报错
c: 盘路径
npm 超时
一键安装
高级用法
# 诊断模式
claw skill run windows-esm-installer --diagnose
# 指定路径
claw skill run windows-esm-installer --path "C:\project"
📋 输出示例
诊断报告
### 🔍 Windows 安装环境诊断报告
**生成时间:** 2026-04-06 15:55
---
### 📊 系统检测
| 组件 | 状态 | 版本 |
|------|------|------|
| Node.js | ✅ | v22.22.0 |
| npm | ✅ | v10.8.0 |
---
### 💡 建议
✅ 环境良好,可以安装
修复完成
### ✅ Windows 安装环境已修复
**检测结果:**
- Node.js: v22.22.0 ✅
- npm: v10.8.0 ✅
- npm 镜像源:已设置 ✅
**生成文件:**
- install.bat
- install.ps1
- INSTALL_REPORT.md
---
### 🚀 下一步
双击运行 install.bat 开始安装
⚙️ 配置
系统要求
| 组件 | 要求 | 说明 |
|---|---|---|
| Windows | 10/11 | 不支持 macOS/Linux |
| Node.js | ≥18.0.0 | LTS 版本推荐 |
| npm | ≥9.0.0 | 随 Node.js 安装 |
可选组件
- zstd(某些 Skill 需要)
- git(Skill 发布需要)
🔧 技术原理
路径修复
// c:\path\to\file → file:///c:/path/to/file
function fixWindowsPath(inputPath: string): string {
const normalized = inputPath.replace(/\\/g, '/');
return `file:///${normalized.replace(/^\/+/, '')}`;
}
依赖检测
- 执行
node --version检测 Node.js - 执行
npm --version检测 npm - 检查版本是否满足要求
脚本生成
自动生成 Windows 批处理和 PowerShell 脚本,包含:
- 系统检测
- 镜像源设置
- 依赖安装
- 报告生成
📝 使用场景
- ESM URL 报错 - 自动修复路径
- npm 下载超时 - 切换国内镜像
- 安装失败 - 诊断环境问题
- 批量部署 - 生成安装脚本
🐛 常见问题
Q: 安装后还是报错?
A: 运行 --diagnose 诊断模式查看详细报告。
Q: 支持中文路径吗?
A: 支持,但建议使用英文路径。
Q: 需要管理员权限吗?
A: 部分操作需要,脚本会自动请求提权。
Q: 如何回滚?
A: 删除 node_modules 和 package-lock.json 后重试。
📊 性能指标
| 指标 | 修复前 | 修复后 | 提升 |
|---|---|---|---|
| npm install | 5 分钟+ | 45 秒 | 6.7x |
| 路径错误率 | 80% | 0% | 100% |
| 安装成功率 | 35% | 95% | 2.7x |
📄 许可证
MIT License
🔗 相关链接
作者: 郑宇航
版本: 1.0.0
最后更新: 2026-04-06
Comments
Loading comments...
