vuejs/vue-cli · error · Error
The project seems to require pnpm${_hasPnpm ? ' >= 3' : ''}
Error message
The project seems to require pnpm${_hasPnpm ? ' >= 3' : ''} but it's not installed. What it means
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.
Source
Thrown at packages/@vue/cli-shared-utils/lib/env.js:128
exports.hasPnpm3OrLater = () => {
return this.hasPnpmVersionOrLater('3.0.0')
}
exports.hasProjectPnpm = (cwd) => {
if (_pnpmProjects.has(cwd)) {
return checkPnpm(_pnpmProjects.get(cwd))
}
const lockFile = path.join(cwd, 'pnpm-lock.yaml')
const result = fs.existsSync(lockFile)
_pnpmProjects.set(cwd, result)
return checkPnpm(result)
}
function checkPnpm (result) {
if (result && !exports.hasPnpm3OrLater()) {
throw new Error(`The project seems to require pnpm${_hasPnpm ? ' >= 3' : ''} but it's not installed.`)
}
return result
}
const _npmProjects = new LRU({
max: 10,
maxAge: 1000
})
exports.hasProjectNpm = (cwd) => {
if (_npmProjects.has(cwd)) {
return _npmProjects.get(cwd)
}
const lockFile = path.join(cwd, 'package-lock.json')
const result = fs.existsSync(lockFile)
_npmProjects.set(cwd, result)
return result
}View on GitHub (pinned to 7eb93c169c)
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.
Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs')
const path = require('path')
const { hasPnpm3OrLater } = require('@vue/cli-shared-utils/lib/env')
const needsPnpm = fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'))
if (needsPnpm && !hasPnpm3OrLater()) console.warn('Project uses pnpm but pnpm>=3 is not installed: npm i -g pnpm') Try / catch
try { hasProjectPnpm(cwd) } catch (e) { /* prompt user to install pnpm or remove pnpm-lock.yaml */ } Prevention
- Check hasPnpm3OrLater() before relying on hasProjectPnpm().
- On CI, add a pnpm setup step or remove pnpm-lock.yaml to switch package managers.
When it happens
Trigger: Calling hasProjectPnpm in a project with a pnpm-lock.yaml on a machine where pnpm is missing or older than v3.
Common situations: Cloning a pnpm project on a machine/CI without pnpm; stale global pnpm below v3; switching package managers without removing the old lockfile.
Related errors
- The project seems to require yarn but it's not installed.
- You are using an outdated version of NPM. It does not suppor
- Require global @vue/cli "${range}", but was invoked by "${th
- Can't find ${packageName} in node_modules. Please install th
- At least one dependency can't be found. Please install the d
AI-assisted analysis of vuejs/vue-cli@7eb93c169c (2026-08-13).
Data as JSON: /api/errors/da68379b670ff20e.
Report an issue: GitHub.