dotnet/aspnetcore · error · Error
The intermediate output path was not provided.
Error message
The intermediate output path was not provided.
What it means
pack-workspace.mjs requires an intermediate output path as argv[6] where it writes and later reads packagesToPack.json and renames.json used to coordinate the two-phase --update-versions / --create-packages flow. Missing it aborts the script.
Source
Thrown at eng/scripts/npm/pack-workspace.mjs:34
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') {
if (!existsSync(packageOutputPath)) {
throw new Error(`The package output path ${packageOutputPath} does not exist.`);
}
View on GitHub (pinned to 3600ca084e)
Solutions
- Pass the intermediate working directory as the 6th positional argument.
- Ensure the MSBuild property feeding intermediateOutputPath is set (typically the obj directory).
- Run --update-versions and --create-packages with the same intermediate path so the JSON handoff files line up.
Example fix
// before node pack-workspace.mjs --update-versions ./pkg/package.json 8.0.0 artifacts/packages // after node pack-workspace.mjs --update-versions ./pkg/package.json 8.0.0 artifacts/packages artifacts/intermediate
Defensive patterns
Strategy: validation
Validate before calling
if (!process.argv[6]) {
console.error('Intermediate output path (argv[6]) required');
process.exit(2);
} Type guard
const isNonEmpty = (s) => typeof s === 'string' && s.length > 0;
Prevention
- Pass the intermediate output path (argv[6]) consistently to both actions.
- Point it at the obj directory of the build.
- Keep --update-versions and --create-packages using the same intermediate path.
When it happens
Trigger: Invoking the script with argv[6] (intermediateOutputPath) missing or empty (pack-workspace.mjs:18,33-35).
Common situations: The build target omitted the intermediate/obj directory argument; a CI yaml refactor dropped the parameter; the property pointing at $(IntermediateOutputPath) was empty.
Related errors
- The workspace path was not provided.
- The default package version was not provided.
- The package output path was not provided.
- The action ${action} is not supported.
- The package output path ${packageOutputPath} does not exist.
AI-assisted analysis of dotnet/aspnetcore@3600ca084e (2026-08-11).
Data as JSON: /api/errors/d2208db0e263f071.
Report an issue: GitHub.