{"record":{"id":"da68379b670ff20e","repo":"vuejs/vue-cli","slug":"the-project-seems-to-require-pnpm-haspnpm","errorCode":null,"errorMessage":"The project seems to require pnpm${_hasPnpm ? ' >= 3' : ''} but it's not installed.","messagePattern":"The project seems to require pnpm(.+?) but it's not installed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@vue/cli-shared-utils/lib/env.js","lineNumber":128,"sourceCode":"\nexports.hasPnpm3OrLater = () => {\n  return this.hasPnpmVersionOrLater('3.0.0')\n}\n\nexports.hasProjectPnpm = (cwd) => {\n  if (_pnpmProjects.has(cwd)) {\n    return checkPnpm(_pnpmProjects.get(cwd))\n  }\n\n  const lockFile = path.join(cwd, 'pnpm-lock.yaml')\n  const result = fs.existsSync(lockFile)\n  _pnpmProjects.set(cwd, result)\n  return checkPnpm(result)\n}\n\nfunction checkPnpm (result) {\n  if (result && !exports.hasPnpm3OrLater()) {\n    throw new Error(`The project seems to require pnpm${_hasPnpm ? ' >= 3' : ''} but it's not installed.`)\n  }\n  return result\n}\n\nconst _npmProjects = new LRU({\n  max: 10,\n  maxAge: 1000\n})\nexports.hasProjectNpm = (cwd) => {\n  if (_npmProjects.has(cwd)) {\n    return _npmProjects.get(cwd)\n  }\n\n  const lockFile = path.join(cwd, 'package-lock.json')\n  const result = fs.existsSync(lockFile)\n  _npmProjects.set(cwd, result)\n  return result\n}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/vuejs/vue-cli/blob/7eb93c169c7520935252e2473387f923ef80d856/packages/@vue/cli-shared-utils/lib/env.js#L110-L146","documentation":"hasProjectPnpm checks for pnpm-lock.yaml; checkPnpm throws if a lockfile is present but pnpm (>= 3, via hasPnpm3OrLater) is not installed, because the project requires pnpm yet the environment cannot satisfy it.","triggerScenarios":"Calling hasProjectPnpm in a project with a pnpm-lock.yaml on a machine where pnpm is missing or older than v3.","commonSituations":"Cloning a pnpm project on a machine/CI without pnpm; stale global pnpm below v3; switching package managers without removing the old lockfile.","solutions":["Install pnpm: `npm i -g pnpm` or `corepack enable`.","Upgrade an old pnpm to v3+.","If you intend to use npm/yarn instead, remove pnpm-lock.yaml and reinstall."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('fs')\nconst path = require('path')\nconst { hasPnpm3OrLater } = require('@vue/cli-shared-utils/lib/env')\nconst needsPnpm = fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))\nif (needsPnpm && !hasPnpm3OrLater()) console.warn('Project uses pnpm but pnpm>=3 is not installed: npm i -g pnpm')","typeGuard":null,"tryCatchPattern":"try { hasProjectPnpm(cwd) } catch (e) { /* prompt user to install pnpm or remove pnpm-lock.yaml */ }","preventionTips":["Check hasPnpm3OrLater() before relying on hasProjectPnpm().","On CI, add a pnpm setup step or remove pnpm-lock.yaml to switch package managers."],"tags":["package-manager","pnpm","environment"],"backgroundTag":null,"analyzedSha":"7eb93c169c7520935252e2473387f923ef80d856","analyzedAt":"2026-08-13T10:13:37.803Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}