pnpm/pnpm · error · PnpmError
VERSIONING_UNKNOWN_PACKAGE
VERSIONING_UNKNOWN_PACKAGE
Error message
Change intent file ${intent.filePath} names ${ref}, which is not a package in this workspace What it means
Change intent files (.changeset/*.md) drive pnpm's native versioning; their YAML frontmatter maps package references (package name or ./directory) to bump types. During plan assembly resolveIntents resolves every reference through the project ref index and throws VERSIONING_UNKNOWN_PACKAGE when a reference matches zero workspace projects — a release plan cannot be built from a name the engine cannot attribute.
Source
Thrown at pnpm11/releasing/versioning/src/assembleReleasePlan.ts:639
/**
* Resolves every intent's package references to participant directories,
* validating along the way: unknown references and names matching several
* projects are hard errors, and a release can only be demanded from a
* participant — otherwise the intent could never be consumed and the file
* would linger forever. A `none` decline is fine for any workspace package.
*/
function resolveIntents (
intents: ChangeIntent[],
refs: ProjectRefIndex,
participants: Map<string, Participant>
): Map<string, Map<string, IntentBumpType>> {
const intentBumps = new Map<string, Map<string, IntentBumpType>>()
for (const intent of intents) {
const byDir = new Map<string, IntentBumpType>()
for (const [ref, bumpType] of Object.entries(intent.releases)) {
const dirs = refs.refToDirs(ref)
if (dirs.length === 0) {
throw new PnpmError('VERSIONING_UNKNOWN_PACKAGE', `Change intent file ${intent.filePath} names ${ref}, which is not a package in this workspace`)
}
if (dirs.length > 1) {
throw new PnpmError(
'VERSIONING_AMBIGUOUS_PACKAGE',
`Change intent file ${intent.filePath} names ${ref}, which matches multiple workspace projects: ${dirs.map((dir) => `./${dir}`).join(', ')}. ` +
'Reference the project by directory instead, e.g. "./' + dirs[0] + '": ' + bumpType
)
}
const dir = dirs[0]
if (bumpType !== 'none' && !participants.has(dir)) {
throw new PnpmError(
'VERSIONING_UNRELEASABLE_PACKAGE',
`Change intent file ${intent.filePath} requests a ${bumpType} release of ${ref}, which cannot release ` +
'(it is listed in versioning.ignore, has no version field, or has a non-semver version). ' +
'Remove the entry or change it to "none".'
)
}
const existing = byDir.get(dir)View on GitHub (pinned to 6261b7f388)
Solutions
- Fix the reference: use the exact name from the package's package.json, or the ./workspace-relative directory form
- If the package no longer exists, delete or edit the stale .changeset/*.md file named in the message
- Regenerate the intent with `pnpm change`, which only offers real workspace packages
Example fix
# .changeset/loud-moose.md — before --- "@scope/widgts": patch --- Fix rendering glitch # after --- "@scope/widgets": patch --- Fix rendering glitch
Defensive patterns
Strategy: validation
Validate before calling
import glob from 'fast-glob'
import { readFile } from 'node:fs/promises'
// Validate intent files against real workspace packages before committing them.
export async function assertIntentsNameRealPackages (workspaceDir: string, names: Set<string>, dirs: Set<string>): Promise<void> {
const files = await glob(['*.md'], { cwd: `${workspaceDir}/.changeset`, ignore: ['readme.md'] })
for (const file of files) {
const content = await readFile(`${workspaceDir}/.changeset/${file}`, 'utf8')
const m = content.match(/^---\n([\s\S]*?)\n---/)
if (m == null) continue
for (const line of m[1].split('\n')) {
const ref = JSON.parse(`"${line.slice(0, line.indexOf(':')).trim()}"`)
const ok = ref.startsWith('./') ? dirs.has(ref.slice(2)) : names.has(ref)
if (!ok) throw new Error(`${file} references unknown package ${ref}`)
}
}
} Try / catch
try {
await assembleReleasePlan(opts)
} catch (err) {
if (err instanceof PnpmError && err.code === 'VERSIONING_UNKNOWN_PACKAGE') {
// The message names the intent file and the bad reference; fix or delete the file
throw new Error(`Bad change intent: ${err.message}`)
}
throw err
} Prevention
- Generate intents with `pnpm change` instead of hand-writing files — it only offers real packages
- Run an intent-lint step in CI that checks every frontmatter key against the current project list
- Clean up .changeset/ intents in the same PR that removes or renames a package
When it happens
Trigger: An intent file whose frontmatter contains a key that is neither a workspace package's name nor a ./directory of a workspace project: a typo ('@scope/errr'), a package that was removed or renamed after the intent was written, or a directory outside the workspace globs.
Common situations: Hand-written intent files with misspelled package names; intents left in .changeset/ after a package was deleted or renamed; referencing a package that exists only in a different workspace/branch.
Related errors
- VERSIONING_NO_PACKAGES
- VERSIONING_UNRELEASABLE_PACKAGE
- INVALID_CHANGE_INTENT
- NOT_LOGGED_IN
- CATALOG_VERSION_MISMATCH
AI-assisted analysis of pnpm/pnpm@6261b7f388 (2026-08-17).
Data as JSON: /api/errors/842c28cb1d31e465.
Report an issue: GitHub.