Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Un-deprecating a package returns EUSAGE error #4824

Open
2 tasks done
Luna-Klatzer opened this issue Apr 28, 2022 · 9 comments
Open
2 tasks done

[BUG] Un-deprecating a package returns EUSAGE error #4824

Luna-Klatzer opened this issue Apr 28, 2022 · 9 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@Luna-Klatzer
Copy link

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

When trying to un-deprecate certain versions of my @kipper/base module, there is an error saying there is a usage error, despite following the guidelines on the docs page:

To un-deprecate a package, specify an empty string ("") for the message argument. Note that you must use double quotes with no space between them to format an empty string.
From here

My command:

npm deprecate @kipper/base@0.2.0 ""

The output:

npm ERR! code EUSAGE
npm ERR!
npm ERR! Deprecate a version of a package
npm ERR!
npm ERR! Usage:
npm ERR! npm deprecate <pkg>[@<version>] <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:
npm ERR!     C:\Users\Luna\AppData\Local\npm-cache\_logs\2022-04-28T15_31_41_080Z-debug-0.log

Full verbose log:

33 verbose stack Error: 
33 verbose stack Deprecate a version of a package
33 verbose stack
33 verbose stack Usage:
33 verbose stack npm deprecate <pkg>[@<version>] <message>
33 verbose stack
33 verbose stack Options:
33 verbose stack [--registry <registry>] [--otp <otp>]
33 verbose stack
33 verbose stack Run "npm help deprecate" for more info
33 verbose stack     at Deprecate.usageError (C:\Users\Luna\AppData\Roaming\npm\node_modules\npm\lib\base-command.js:88:26)
33 verbose stack     at Deprecate.exec (C:\Users\Luna\AppData\Roaming\npm\node_modules\npm\lib\commands\deprecate.js:37:18)
33 verbose stack     at Npm.exec (C:\Users\Luna\AppData\Roaming\npm\node_modules\npm\lib\npm.js:169:29)
33 verbose stack     at async module.exports (C:\Users\Luna\AppData\Roaming\npm\node_modules\npm\lib\cli.js:78:5)
34 verbose cwd C:\Users\Luna
35 verbose Windows_NT 10.0.19043
36 verbose node v16.13.0
37 verbose npm  v8.8.0
38 error code EUSAGE
39 error
39 error Deprecate a version of a package
39 error
39 error Usage:
39 error npm deprecate <pkg>[@<version>] <message>
39 error
39 error Options:
39 error [--registry <registry>] [--otp <otp>]
39 error
39 error Run "npm help deprecate" for more info
40 verbose exit 1
41 timing npm Completed in 49ms
42 verbose code 1
43 error A complete log of this run can be found in:
43 error     C:\Users\Luna\AppData\Local\npm-cache\_logs\2022-04-28T15_31_41_080Z-debug-0.log

Expected Behavior

The command should execute properly and un-deprecate the package.

Steps To Reproduce

  1. Login into npm using npm login
  2. Run npm deprecate PACKAGE@VERSION ""

Environment

  • npm: 8.8.0
  • Node.js: 16.13.0
  • OS Name: Windows
  • System Model Name: Custom
  • npm config:
; "builtin" config from C:\Users\Luna\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\Luna\\AppData\\Roaming\\npm"

; "global" config from C:\Users\Luna\AppData\Roaming\npm\etc\npmrc

; python = "C:\\Users\\Luna\\.windows-build-tools\\python27\\python.exe" ; overridden by user

; "user" config from C:\Users\Luna\.npmrc

@kipper:registry = "https://registry.npmjs.org/"
//registry.npmjs.org/:_authToken = (protected)
python = "C:\\Users\\Luna\\.windows-build-tools\\python27\\python.exe"
scope = "@kipper"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v16.13.0
; npm local prefix = C:\Users\Luna
; npm version = 8.8.0
; cwd = C:\Users\Luna
; HOME = C:\Users\Luna
; Run `npm config ls -l` to show all defaults.
@Luna-Klatzer Luna-Klatzer added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Apr 28, 2022
@ulvimammaadov
Copy link

I think the problem is in your npm config file

@wopian
Copy link

wopian commented Aug 11, 2022

Also facing this issue preventing versions from being undeprecated, appears to be another regression of #3484

This only happens on Windows. The command executes as expected on macOS 12 and Alpine Linux

npm config

; "builtin" config from C:\Users\wopia\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\wopia\\AppData\\Roaming\\npm"

; "user" config from C:\Users\wopia\.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.5.0
; npm local prefix = C:\GitHub\wopian\kitsujs
; npm version = 8.17.0
; cwd = C:\GitHub\wopian\kitsujs
; HOME = C:\Users\wopia
; Run `npm config ls -l` to show all defaults.

@cd10anil
Copy link

Any update or workaround, facing the same issue?

@cd10anil
Copy link

cd10anil commented Jan 14, 2023

Any update or workaround, facing the same issue?

Fixed it, on created the react app with npx create then ran upgrade and
npm audit fix --force
as suggested when run successfully but with compiled and got comments when implemented/run. this breaks it. and got the above error. the thing it fixed is by using the command
npm install react@latest
followed by

npm install react-dom@latest
npm install react-scripts@latest

@JohnCampionJr
Copy link

This is still an issue. Confirmed to be on Windows; works fine on my Mac.

@ebickle
Copy link

ebickle commented Aug 16, 2023

I realized this only occurs while using Powershell. Switching to Command Prompt solved the problem.

Try double-quoting the argument (two double quotes inside of two single quotes), like this: npm deprecate package@1.0.0 '""'

@BonjourYY
Copy link

I have faced the same problem and it still exists. I found that this issue occurs in PowerShell, but it does not occur in Git Bash.

@Amirali-Khamseh
Copy link

This problem could be resolved by adding the package-lock.json , run npm install and then try npm ci

@kolmek1007
Copy link

I have error but i don't know how i can solve it:
PS C:\Users\kolme\Downloads\API_REST_1> npm star
npm ERR! code EUSAGE
npm ERR!
npm ERR! Mark your favorite packages
npm ERR!
npm ERR! Usage:
npm ERR! npm star [...]
npm ERR!
npm ERR! Options:
npm ERR! [--registry ] [--no-unicode] [--otp ]
npm ERR!
npm ERR! Run "npm help star" for more info

npm ERR! A complete log of this run can be found in: C:\Users\kolme\AppData\Local\npm-cache_logs\2024-06-25T15_18_56_495Z-debug-0.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

9 participants