We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58e112d commit 2159074Copy full SHA for 2159074
cli/src/npm-client.ts
@@ -448,13 +448,23 @@ export async function packageDeprecate(
448
options?: { dryRun?: boolean; registry?: string },
449
): Promise<NpmExecResult> {
450
validatePackageName(pkg)
451
+
452
+ const reasonText = reason.trim()
453
454
+ if (!reasonText) {
455
+ throw new Error('Deprecation reason must not be empty')
456
+ }
457
458
const target = version ? `${pkg}@${version}` : pkg
459
const args = ['deprecate', target, reason]
460
461
if (options?.dryRun) {
462
args.push('--dry-run')
463
}
464
465
if (options?.registry?.trim()) {
466
args.push('--registry', options.registry.trim())
467
468
469
return execNpm(args, { otp })
470
0 commit comments