{"record":{"id":"015c86552218c8e3","repo":"pulumi/pulumi","slug":"the-bun-runtime-requires-pulumi-pulumi-s-but","errorCode":null,"errorMessage":"the bun runtime requires @pulumi/pulumi >= %s, but %s is installed; ensure all copies of @pulumi/pulumi are updated to >= %s and re-run `pulumi install`","messagePattern":"the bun runtime requires @pulumi/pulumi >= (.+?), but (.+?) is installed; ensure all copies of @pulumi/pulumi are updated to >= (.+?) and re-run `pulumi install`","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/nodejs/cmd/pulumi-language-nodejs/main.go","lineNumber":441,"sourceCode":"\t\treturn fmt.Errorf(\"could not resolve package manager: %w\", err)\n\t}\n\n\tpackages, err := pm.ListPackages(ctx, programDirectory, true /*transitive*/)\n\tif err != nil {\n\t\tlogging.V(5).Infof(\"skipping @pulumi/pulumi version check: %v\", err)\n\t\treturn nil\n\t}\n\n\tfor _, pkg := range packages {\n\t\tif pkg.Name == \"@pulumi/pulumi\" {\n\t\t\tv, err := semver.Parse(pkg.Version)\n\t\t\tif err != nil {\n\t\t\t\tlogging.V(5).Infof(\"skipping @pulumi/pulumi version check: could not parse version %q: %v\",\n\t\t\t\t\tpkg.Version, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif v.LT(minBunPulumiSDKVersion) {\n\t\t\t\treturn fmt.Errorf(\"the bun runtime requires @pulumi/pulumi >= %s, but %s is installed; \"+\n\t\t\t\t\t\"ensure all copies of @pulumi/pulumi are updated to >= %s and re-run `pulumi install`\",\n\t\t\t\t\tminBunPulumiSDKVersion, v, minBunPulumiSDKVersion)\n\t\t\t}\n\t\t}\n\t}\n\n\tlogging.V(5).Info(\"skipping @pulumi/pulumi version check: package not found in lockfile\")\n\treturn nil\n}\n\nfunc compatibleVersions(a, b semver.Version) (bool, string) {\n\tswitch {\n\tcase a.Major == 0 && b.Major == 0:\n\t\t// If both major versions are pre-1.0, we require that the major and minor versions match.\n\t\tif a.Minor != b.Minor {\n\t\t\treturn false, \"Differing major or minor versions are not supported.\"\n\t\t}\n","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/nodejs/cmd/pulumi-language-nodejs/main.go#L423-L459","documentation":"When runtime is bun, the language host enforces a minimum @pulumi/pulumi SDK version (minBunPulumiSDKVersion) because bun support relies on newer SDK features. It scans installed @pulumi/pulumi packages (including transitive copies) and fails the deployment if any resolved version is older than the minimum.","triggerScenarios":"Running `pulumi up` with runtime: bun while node_modules contains @pulumi/pulumi older than the required minimum — typically because `pulumi install` hasn't been re-run since upgrading the CLI, or a transitive dependency pins an old version.","commonSituations":"Upgrading the Pulumi CLI to a version raising minBunPulumiSDKVersion without reinstalling; a nested dependency depending on an old @pulumi/pulumi; lockfile pinning stale versions; multiple copies in node_modules with one stale.","solutions":["Run `pulumi install` in the program directory so all copies of @pulumi/pulumi update to >= the required version","Bump the @pulumi/pulumi dependency in package.json to the latest and regenerate the lockfile (bun install)","Check for transitive dependencies pinning an old @pulumi/pulumi and update/override them"],"exampleFix":"// before (package.json)\n\"dependencies\": { \"@pulumi/pulumi\": \"3.80.0\" }\n// after\n\"dependencies\": { \"@pulumi/pulumi\": \"^3.113.0\" }\n// then run: pulumi install","handlingStrategy":"validation","validationCode":"// pre-flight check before pulumi up with bun\nexecSync(\"bun pm ls | grep @pulumi/pulumi\"); // confirm installed versions meet the CLI minimum","typeGuard":null,"tryCatchPattern":"try {\n  await pulumiUp();\n} catch (err) {\n  if (String(err).includes(\"requires @pulumi/pulumi >=\")) {\n    execSync(\"pulumi install\", { cwd: programDir });\n    await pulumiUp();\n  } else { throw err; }\n}","preventionTips":["Re-run `pulumi install` whenever you upgrade the Pulumi CLI","Keep @pulumi/pulumi on the latest version in package.json and regenerate the lockfile","Audit transitive dependencies for pins on old @pulumi/pulumi copies"],"tags":["bun","version-check","nodejs","dependencies"],"backgroundTag":"sdk-version-too-old","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}