You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用npm安装Maestro移动自动化工具时遇报错求助

解决Windows下npm安装Maestro的错误

错误原因

你遇到的错误是因为Maestro的npm包在安装过程中尝试执行./bin/welcome-message.sh shell脚本,但Windows的PowerShell/CMD默认不支持直接运行.sh文件,导致命令执行失败。

解决方案

1. 使用官方推荐的Windows安装方式(优先选择)

Maestro官方不建议在Windows上通过npm安装,推荐以下两种方式:

  • Chocolatey安装:确保已安装Chocolatey后,在PowerShell中运行:
    choco install maestro
    
  • 手动下载二进制文件:
    • 下载对应Windows版本的Maestro二进制包
    • 解压后将包含maestro.exe的文件夹路径添加到系统环境变量PATH中

2. 通过WSL安装

如果坚持使用npm安装,可以在Windows Subsystem for Linux(WSL)中执行安装命令:

npm install -g maestro

WSL支持shell脚本,能正常完成安装流程。

3. 跳过安装脚本(不推荐)

临时绕过postinstall脚本执行,命令如下:

npm install -g maestro --ignore-scripts

⚠️ 注意:此方法会跳过安装后的初始化步骤和欢迎信息,可能导致部分功能无法正常使用,仅作为临时应急方案。

错误日志原文:
PS C:\Users\tgt587\Desktop\MMT> npm install -g maestro
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm ERR! code 1
npm ERR! path C:\Users\tgt587\AppData\Roaming\npm\node_modules\maestro
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c ./bin/welcome-message.sh
npm ERR! '.' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in: C:\Users\tgt587\AppData\Local\npm-cache_logs\2023-12-11T07_31_42_603Z-debug-0.log
PS C:\Users\tgt587\Desktop\MMT>

内容的提问来源于stack exchange,提问作者Jagadesh Waran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 06:16:08