npm / npm/cli

[BUG] Cannot undeprecate

Open
#5,597 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

I did a

npm deprecate mylib 3.6.0 "Please upgrade to latest"

which deprecated the whole package as I forgot the @ symbol between mylib and the version.

Now, if I try to undeprecate with:

npm deprecate mylib ""

or individually with

npm deprecate mylib@3.5.0 ""

I have got a "code EUSAGE" error.

I am using npm version 8.19.2

Expected Behavior

Following the npm documentation, It should un-deprecate when passing an empty message.

Steps To Reproduce
  1. In this environment...
    Windows 11
    node v16.17.0
    npm v8.19.2

...

  1. Run
npm deprecate mylib "Some deprecation message"
npm deprecate mylib ""
npm deprecate mylib@1.0.0 ""
  1. See error...
npm ERR! code EUSAGE
npm ERR!
npm ERR! Deprecate a version of a package
npm ERR!
npm ERR! Usage:
npm ERR! npm deprecate <package-spec> <message>
npm ERR!
npm ERR! Options:
npm ERR! [--registry <registry>] [--otp <otp>]
npm ERR!
npm ERR! Run "npm help deprecate" for more info

npm ERR! A complete log of this run can be found in:


Environment
  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the npm deprecate commands shown in the issue, especially the empty-message cases, using npm 8.19.2 on the stated environment. Trace the deprecate command's argument validation and verify that both package-wide and version-specific empty messages complete without EUSAGE.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.