{"record":{"id":"1b3e406de708f448","repo":"dotnet/aspnetcore","slug":"the-package-output-path-packageoutputpath-does","errorCode":null,"errorMessage":"The package output path ${packageOutputPath} does not exist.","messagePattern":"The package output path (.+?) does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"eng/scripts/npm/pack-workspace.mjs","lineNumber":50,"sourceCode":"\nif (!intermediateOutputPath) {\n  throw new Error('The intermediate output path was not provided.');\n}\n\n// Log all the captured process arguments\nconsole.log(`Workspace Path: ${workspacePath}`);\nconsole.log(`Default Package Version: ${defaultPackageVersion}`);\nconsole.log(`Package Output Path: ${packageOutputPath}`);\nconsole.log(`Intermediate Output Path: ${intermediateOutputPath}`);\n\nif (action === '--update-versions') {\n  const [packagesToPack, renames] = applyVersions(defaultPackageVersion, workspacePath);\n  // Write packagesToPack and renames to a file\n  writeJsonSync(resolve(intermediateOutputPath, 'packagesToPack.json'), packagesToPack);\n  writeJsonSync(resolve(intermediateOutputPath, 'renames.json'), renames);\n} else if (action === '--create-packages') {\n  if (!existsSync(packageOutputPath)) {\n    throw new Error(`The package output path ${packageOutputPath} does not exist.`);\n  }\n\n  // Read packagesToPack and renames from a file\n  const packagesToPack = readJsonSync(resolve(intermediateOutputPath, 'packagesToPack.json'));\n  const renames = readJsonSync(resolve(intermediateOutputPath, 'renames.json'));\n  try {\n    createPackages(packagesToPack);\n  } finally {\n    // Restore the package.json files to their \"originals\"\n    for (const [from, to] of renames) {\n      moveSync(from, to, { overwrite: true });\n    }\n  }\n} else {\n  throw new Error(`The action ${action} is not supported.`);\n}\n\n// For each package to pack run npm pack","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/eng/scripts/npm/pack-workspace.mjs#L32-L68","documentation":"During the --create-packages action the script checks that the supplied packageOutputPath exists on disk before writing tarballs into it. Unlike --update-versions, --create-packages does not create the directory, so it must already be present.","triggerScenarios":"Running with action --create-packages when packageOutputPath does not exist on the filesystem (pack-workspace.mjs:48-50). Typical when the directory creation step was skipped or the path is wrong.","commonSituations":"Build orchestration ran --create-packages without first creating/mkdir-ing the output directory; wrong relative path because cwd differs between phases; --update-variants phase that normally creates the dir did not run.","solutions":["Create the packageOutputPath directory before invoking --create-packages (e.g. mkdir -p or an MSBuild EnsureExists).","Verify the path passed is absolute or correct relative to the script's cwd.","Ensure the --update-versions phase (which typically precedes create-packages) ran successfully and produced the dir."],"exampleFix":"// before\nnode pack-workspace.mjs --create-packages ./pkg/package.json 8.0.0 missing-dir artifacts/int\n// after\nfs.mkdirSync('missing-dir', { recursive: true });\nnode pack-workspace.mjs --create-packages ./pkg/package.json 8.0.0 missing-dir artifacts/int","handlingStrategy":"validation","validationCode":"import { existsSync, mkdirSync } from 'fs';\nif (action === '--create-packages') {\n    if (!existsSync(packageOutputPath)) mkdirSync(packageOutputPath, { recursive: true });\n}","typeGuard":"const dirExists = (p) => typeof p === 'string' && p.length > 0 && existsSync(p);","tryCatchPattern":"try {\n  require('child_process').execFileSync('node', ['pack-workspace.mjs','--create-packages', ws, ver, outDir, intDir]);\n} catch (e) {\n  if (/does not exist/.test(e.message)) fs.mkdirSync(outDir, { recursive: true });\n  throw e;\n}","preventionTips":["mkdir -p the output directory before --create-packages.","Run --update-versions first (it typically creates the directory).","Use absolute paths to avoid cwd-relative surprises."],"tags":["nodejs","npm","build","filesystem","cli"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}