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

M2 Mac(Ventura系统)wml start无响应及watchman报错问题求助

在M2 Mac(macOS 13+ Ventura)上解决wml配置及watchman报错问题

1. 找到wml的准确全局安装目录

你全局安装的wml是一个文件夹,而非单个执行文件。执行以下命令快速定位:

  • 查看全局npm包根目录:
    npm root -g
    
    M2 Mac上通常返回/opt/homebrew/lib/node_modules,因此wml的完整目录为/opt/homebrew/lib/node_modules/wml
  • 或者直接查看wml的安装路径:
    npm list -g wml
    
    输出结果会明确显示wml的具体安装位置。

你之前错误指定了/opt/homebrew/lib/node_modules/wml/src/cli/index.js(这是wml的执行文件,不是目录),这就是watchman报错"Not a directory"的核心原因。

2. 解决watchman的权限与目录错误

权限报错处理

不要用sudo运行watchman——watchman的状态目录(/opt/homebrew/var/run/watchman/root-state)所有者为你的当前用户(uid 501),用sudo切换到root用户会导致权限不匹配,直接用当前用户执行命令即可。

正确的watchman监视命令

监视wml的安装目录而非单个文件:

watchman watch /opt/homebrew/lib/node_modules/wml

3. 解决wml start无反应的问题

wml start默认无输出,需按以下步骤排查:

  • 先添加文件映射:wml是目录同步工具,必须先添加映射才能工作。执行:
    wml add <源目录路径> <目标目录路径>
    
    示例:wml add ~/MyProjects/source ~/MyProjects/target
  • 查看详细日志:启动verbose模式,查看是否有隐藏错误:
    wml start --verbose
    
  • 重新安装wml:若上述步骤无效,尝试重装确保安装完整:
    npm uninstall -g wml
    npm install -g wml
    

内容的提问来源于stack exchange,提问作者Wai Hyn

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 20:33:09