dotnet/aspnetcore · error · Error
The default package version was not provided.
Error message
The default package version was not provided.
What it means
pack-workspace.mjs requires a default package version as argv[4]. It is used both to stamp each workspace package's version and to derive dependency version ranges, so it cannot be blank.
Source
Thrown at eng/scripts/npm/pack-workspace.mjs:26
// Valid actions are --update-versions and --create-packages
const action = process.argv[2];
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);View on GitHub (pinned to 3600ca084e)
Solutions
- Supply a semver-style default package version as the 4th positional argument.
- Ensure the MSBuild/property that populates the version is defined and non-empty before the script runs.
- Validate the version is set in CI before invoking pack-workspace.mjs.
Example fix
// before node pack-workspace.mjs --update-versions ./pkg/package.json // after node pack-workspace.mjs --update-versions ./pkg/package.json 8.0.0
Defensive patterns
Strategy: validation
Validate before calling
if (!process.argv[4]) {
console.error('Default package version (argv[4]) is required');
process.exit(2);
} Type guard
const isSemverish = (s) => typeof s === 'string' && /^\d+\.\d+/.test(s);
Prevention
- Populate the build version property before the pack target runs.
- Pass the version as argv[4] to pack-workspace.mjs.
- Add a CI precondition that the version is non-empty.
When it happens
Trigger: Invoking the script with argv[4] (defaultPackageVersion) missing or empty (pack-workspace.mjs:14,25-27).
Common situations: The build orchestrator did not pass $(Version) / a NuGet package version property to the script, or it passed an empty string when the version variable was unset at build time.
Related errors
- The workspace path was not provided.
- The package output path was not provided.
- The intermediate output path was not provided.
- The action ${action} is not supported.
- The default package version was not provided.
AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11).
Data as JSON: /api/errors/15a333ae87f822d0.
Report an issue: GitHub.