{"record":{"id":"e3d5ef274c95e4b8","repo":"neoclide/coc.nvim","slug":"required-capabilities-do-not-exist","errorCode":null,"errorMessage":"required capabilities do not exist.","messagePattern":"required capabilities do not exist\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/watchman.ts","lineNumber":160,"sourceCode":"  public dispose(): void {\n    if (this.client) {\n      this.client.end()\n      this.client = undefined\n    }\n  }\n\n  private appendOutput(message: string, type = \"Info\"): void {\n    if (this.channel) {\n      this.channel.appendLine(`[${type}  - ${(new Date().toLocaleTimeString())}] ${message}`)\n    }\n  }\n\n  public static async createClient(binaryPath: string, root: string, channel?: OutputChannel): Promise<Watchman> {\n    let watchman: Watchman\n    try {\n      watchman = new Watchman(binaryPath, channel)\n      let valid = await watchman.checkCapability()\n      if (!valid) throw new Error('required capabilities do not exist.')\n      let watching = await watchman.watchProject(root)\n      if (!watching) throw new Error('unable to watch')\n      return watchman\n    } catch (e) {\n      if (watchman) watchman.dispose()\n      throw e\n    }\n  }\n}\n","sourceCodeStart":142,"sourceCodeEnd":170,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/core/watchman.ts#L142-L170","documentation":"Watchman.createClient connects to the watchman binary and calls checkCapability(); if the installed watchman does not report the required capabilities (required defined via watchman capability checks), the client is disposed and this error is thrown. It means the watchman version on the system is too old or lacks needed features.","triggerScenarios":"Watchman.createClient(binaryPath, root, channel) where await watchman.checkCapability() returns false because the watchman server at binaryPath lacks the required capabilities (e.g. wildcard support, term-based queries).","commonSituations":"Old system watchman (< 3.x) installed via package manager; watchman binary at a custom binaryPath is stale; multiple watchman versions on PATH; watchman service returning errors that make capability checks fail.","solutions":["Install/upgrade watchman to a recent version (e.g. brew install watchman or build from source).","Verify with 'watchman version' that the binary at the configured path supports the needed capabilities.","Remove the old binaryPath configuration so coc.nvim finds the up-to-date watchman on PATH.","Restart the watchman service (watchman shutdown-server) if a stale server is answering."],"exampleFix":"// before\nlet wm = await Watchman.createClient('/usr/bin/old-watchman', root)\n// throws 'required capabilities do not exist.'\n// after\nlet wm = await Watchman.createClient('/opt/homebrew/bin/watchman', root) // recent watchman","handlingStrategy":"validation","validationCode":"const { execFile } = require('child_process')\nfunction checkWatchman(binaryPath) {\n  return new Promise((resolve) => {\n    execFile(binaryPath, ['version'], (err, stdout) => {\n      if (err) return resolve(false)\n      try { resolve(JSON.parse(stdout).version ? true : false } catch { resolve(false) }\n    })\n  })\n}\n// only call Watchman.createClient if checkWatchman returns true and version is recent","typeGuard":null,"tryCatchPattern":"try {\n  const wm = await Watchman.createClient(binaryPath, root)\n} catch (e) {\n  if (e.message === 'required capabilities do not exist.') {\n    logger.error('watchman too old; install >= 4.9 via brew install watchman')\n    // fall back to fs.watch-based watching\n  } else throw e\n}","preventionTips":["Pin a recent watchman version in your dev environment setup.","Run 'watchman version' in your project bootstrap script and fail early if capabilities are missing.","Avoid pointing binaryPath at distro-packaged ancient watchman builds."],"tags":["watchman","file-watcher","environment","version"],"backgroundTag":"missing-required-capability","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}