{"record":{"id":"4a492ec0dc4bdfed","repo":"vercel-labs/agent-skills","slug":"vercel-not-installed","errorCode":"VERCEL_NOT_INSTALLED","errorMessage":"VERCEL_NOT_INSTALLED: `vercel` CLI not found in PATH. Install with `npm i -g vercel@latest`.","messagePattern":"VERCEL_NOT_INSTALLED: `vercel` CLI not found in PATH\\. Install with `npm i -g vercel@latest`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"skills/vercel-optimize/lib/vercel.mjs","lineNumber":99,"sourceCode":"  const command = resolveVercelCommand({ env: opts.env });\n  if (command.missing) {\n    const err = new Error('VERCEL_NOT_INSTALLED: `vercel` CLI not found in PATH. Install with `npm i -g vercel@latest`.');\n    err.code = 'ENOENT';\n    throw err;\n  }\n  return await exec(command.file, [...command.prefix, ...args], { windowsHide: true, ...opts });\n}\n\nconst MIN_CLI_VERSION = [53, 0, 0];\n\n// Pre-v53 lacks `vercel metrics` and `vercel contract`.\nexport async function checkCliVersion() {\n  let raw;\n  try {\n    const { stdout } = await runVercel(['--version']);\n    raw = stdout.trim();\n  } catch (err) {\n    throw new Error('VERCEL_NOT_INSTALLED: `vercel` CLI not found in PATH. Install with `npm i -g vercel@latest`.');\n  }\n  const m = raw.match(/(\\d+)\\.(\\d+)\\.(\\d+)/);\n  if (!m) throw new Error(`VERCEL_VERSION_UNPARSEABLE: ${raw}`);\n  const v = [Number(m[1]), Number(m[2]), Number(m[3])];\n  for (let i = 0; i < 3; i++) {\n    if (v[i] > MIN_CLI_VERSION[i]) return v;\n    if (v[i] < MIN_CLI_VERSION[i]) {\n      throw new Error(\n        `VERCEL_CLI_TOO_OLD: have ${v.join('.')}, need >= ${MIN_CLI_VERSION.join('.')}. Upgrade with \\`npm i -g vercel@latest\\`.`\n      );\n    }\n  }\n  return v;\n}\n\nexport async function checkAuth() {\n  try {\n    await runVercel(['whoami']);","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/vercel-labs/agent-skills/blob/b8caa260a420a73042e35521de4b5c8baf6446cc/skills/vercel-optimize/lib/vercel.mjs#L81-L117","documentation":"Thrown by checkCliVersion() when `runVercel(['--version'])` rejects. runVercel shells out to the `vercel` executable resolved by command.file, so a rejection means no `vercel` binary is on PATH (ENOENT) or exec itself failed. The skill hard-requires the CLI because every signal comes from `vercel metrics`/`usage`/`contract`/`api`, so absence is a hard stop, not a degraded path.","triggerScenarios":"Any call to checkCliVersion() (the first step of collect-signals.mjs main()) on a machine where `vercel` is not installed, not on PATH, or the resolved command.file shim points to a missing binary. Also fires if the global install is corrupt and `vercel --version` exits non-zero before printing anything.","commonSituations":"Fresh CI runner or container without the Vercel CLI installed; a local npx-only workflow where `vercel` was never installed globally; PATH shadowed by a different `vercel` shim; Node installed via a version manager that resets PATH so the globally-installed CLI drops out.","solutions":["Run `npm i -g vercel@latest` (or `pnpm`/`yarn` global equivalent) and confirm with `vercel --version`.","Verify the binary is resolvable: `command -v vercel` returns a path on the same PATH the Node process inherits.","If you cannot install globally, run the script through a wrapper that puts the npx cache bin on PATH, or pin `vercel` as a devDependency and invoke via `node_modules/.bin/vercel`.","In CI, add an explicit `npm i -g vercel@latest` step before the collect-signals job."],"exampleFix":"// before\nawait checkCliVersion(); // throws VERCEL_NOT_INSTALLED on a clean machine\n\n// after — gate the call so you fail with an actionable message before the skill runs\nimport { execFileSync } from 'node:child_process';\ntry { execFileSync('vercel', ['--version'], { stdio: 'ignore' }); }\ncatch { throw new Error('Install Vercel CLI first: npm i -g vercel@latest'); }\nawait checkCliVersion();","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'node:child_process';\n// Run before checkCliVersion()\nfunction assertVercelInstalled() {\n  try { execFileSync('vercel', ['--version'], { stdio: 'pipe' }); }\n  catch (e) { throw new Error('Vercel CLI not on PATH. Install: npm i -g vercel@latest'); }\n}\nassertVercelInstalled();","typeGuard":null,"tryCatchPattern":"try {\n  await checkCliVersion();\n} catch (err) {\n  if (err.message.startsWith('VERCEL_NOT_INSTALLED')) {\n    // actionable: instruct install, do not retry in-process\n    throw new Error('Install Vercel CLI first, then rerun: npm i -g vercel@latest');\n  }\n  throw err;\n}","preventionTips":["Add an `npm i -g vercel@latest` step to CI before the collect-signals job.","Document the CLI requirement in the project README/onboarding.","Pin the CLI in devDependencies as a fallback so node_modules/.bin/vercel always exists."],"tags":["cli","environment","dependency-missing","vercel"],"backgroundTag":null,"analyzedSha":"b8caa260a420a73042e35521de4b5c8baf6446cc","analyzedAt":"2026-08-13T06:03:29.508Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}