{"record":{"id":"d2e79b275b6e30ca","repo":"pulumi/pulumi","slug":"unknown-package-manager-s","errorCode":null,"errorMessage":"unknown package manager: %s","messagePattern":"unknown package manager: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/nodejs/npm/manager.go","lineNumber":219,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"the project's manifest is package.yaml, which is only supported by pnpm, \"+\n\t\t\t\t\t\"but the runtime package manager is set to %q. \"+\n\t\t\t\t\t\"Use pnpm, or convert package.yaml to package.json\", packagemanager)\n\t\t}\n\t\tswitch packagemanager {\n\t\tcase AutoPackageManager:\n\t\t\t// Make the linter for exhaustive switch cases happy, we never get here.\n\t\t\tbreak\n\t\tcase NpmPackageManager:\n\t\t\treturn newNPM()\n\t\tcase YarnPackageManager:\n\t\t\treturn newYarnClassic()\n\t\tcase PnpmPackageManager:\n\t\t\treturn newPnpm()\n\t\tcase BunPackageManager:\n\t\t\treturn newBun()\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown package manager: %s\", packagemanager)\n\t\t}\n\t}\n\n\t// No packagemanager specified, try to determine the best one to use.\n\n\t// If the nearest manifest is a package.yaml, pnpm is the only option. Don't fall through to the other package\n\t// managers since they would fail with a confusing ENOENT.\n\tif requiresPnpm {\n\t\tpnpm, err := newPnpm()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"the project's manifest is package.yaml, which requires pnpm, \"+\n\t\t\t\t\"but pnpm could not be found on the $PATH: %w\", err)\n\t\t}\n\t\treturn pnpm, nil\n\t}\n\n\t// Prefer yarn if PULUMI_PREFER_YARN is truthy, or if yarn.lock exists.\n\tif preferYarn() || checkYarnLock(pwd) {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/nodejs/npm/manager.go#L201-L237","documentation":"When an explicit package manager name is passed to ResolvePackageManager, it is matched against the known types (npm, yarn, pnpm, bun) in a switch (sdk/nodejs/npm/manager.go:206-220). Any string that is not one of the recognized PackageManagerType constants falls into the default branch and returns this error. It is a strict allowlist check on the configured package manager name.","triggerScenarios":"Passing an unrecognized string as packagemanager to ResolvePackageManager, e.g. from a misspelled `packagemanager` option in Pulumi.yaml (such as \"NPM\", \"yarn2\", \"npmclassic\") that does not exactly match a supported value.","commonSituations":"Typo or wrong casing in Pulumi.yaml's runtime options.packagemanager; using a value from an older or newer Pulumi version that no longer exists; hand-editing config with an invented manager name like \"pnpm9\".","solutions":["Use one of the supported values exactly: npm, yarn, pnpm, or bun (lowercase)","Check Pulumi.yaml runtime options.packagemanager for typos or casing errors","Remove the packagemanager option entirely to let Pulumi auto-detect from lockfiles"],"exampleFix":"// before (Pulumi.yaml)\noptions:\n  packagemanager: NPM\n// after\noptions:\n  packagemanager: npm","handlingStrategy":"validation","validationCode":"var validManagers = map[string]bool{\"npm\": true, \"yarn\": true, \"pnpm\": true, \"bun\": true}\n\nfunc validateManagerName(name string) error {\n\tif name != \"\" && name != string(npm.AutoPackageManager) && !validManagers[name] {\n\t\treturn fmt.Errorf(\"unknown package manager %q; must be one of npm, yarn, pnpm, bun\", name)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the exported PackageManagerType constants instead of raw strings","Lint Pulumi.yaml runtime options against the documented set of values","Omit the packagemanager option to get auto-detection","Copy values from docs, avoiding invented names or casing variants"],"tags":["nodejs","package-manager","configuration","invalid-value"],"backgroundTag":"invalid-config-value","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}