dotnet/aspnetcore · error · Error

The package output path was not provided.

Error message

The package output path was not provided.

What it means

pack-workspace.mjs requires a package output path as argv[5]; this is the directory where the produced .tgz tarballs are written during --create-packages. If it is missing the script aborts.

Source

Thrown at eng/scripts/npm/pack-workspace.mjs:30

const workspacePath = process.argv[3];

const defaultPackageVersion = process.argv[4];

const packageOutputPath = process.argv[5];

const intermediateOutputPath = process.argv[6];

// Validate and throw if the arguments are not provided
if (!workspacePath) {
  throw new Error('The workspace path was not provided.');
}

if (!defaultPackageVersion) {
  throw new Error('The default package version was not provided.');
}

if (!packageOutputPath) {
  throw new Error('The package output path was not provided.');
}

if (!intermediateOutputPath) {
  throw new Error('The intermediate output path was not provided.');
}

// Log all the captured process arguments
console.log(`Workspace Path: ${workspacePath}`);
console.log(`Default Package Version: ${defaultPackageVersion}`);
console.log(`Package Output Path: ${packageOutputPath}`);
console.log(`Intermediate Output Path: ${intermediateOutputPath}`);

if (action === '--update-versions') {
  const [packagesToPack, renames] = applyVersions(defaultPackageVersion, workspacePath);
  // Write packagesToPack and renames to a file
  writeJsonSync(resolve(intermediateOutputPath, 'packagesToPack.json'), packagesToPack);
  writeJsonSync(resolve(intermediateOutputPath, 'renames.json'), renames);
} else if (action === '--create-packages') {

View on GitHub (pinned to 3600ca084e)

Solutions

  1. Pass the output directory for .tgz files as the 5th positional argument.
  2. Confirm the MSBuild property (e.g. $(PackageOutputPath)) is set on the target that invokes the script.
  3. Pre-create the directory before running --create-packages (the script also checks existence there).

Example fix

// before
node pack-workspace.mjs --create-packages ./pkg/package.json 8.0.0
// after
mkdir -p artifacts/packages && node pack-workspace.mjs --create-packages ./pkg/package.json 8.0.0 artifacts/packages artifacts/intermediate
Defensive patterns

Strategy: validation

Validate before calling

const out = process.argv[5];
if (!out) { console.error('Package output path (argv[5]) required'); process.exit(2); }
if (action === '--create-packages' && !fs.existsSync(out)) { fs.mkdirSync(out, { recursive: true }); }

Type guard

const isDirPath = (s) => typeof s === 'string' && s.length > 0;

Prevention

When it happens

Trigger: Invoking the script with argv[5] (packageOutputPath) missing or empty (pack-workspace.mjs:16,29-31).

Common situations: The MSBuild target that drives packing did not pass the artifacts output directory; a refactored build dropped the property; running the script manually without specifying where tarballs go.

Related errors


AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11). Data as JSON: /api/errors/ed0f08008c16c84c. Report an issue: GitHub.