[BUG] npm deprecate with large packuments is so slow OTPs expire
Nobody has claimed this yet.
- 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
npm deprecate <message> --otp=xxxxxx takes a very long time to run so long that it prompts for a new OTP, then it retries and takes so long that the second OTP times out.
Deprecating packages via the npm website is fast, but doesn't allow you to add a custom message so the CLI is all that can be used.
Expected Behavior
npm deprecate <message> --otp=xxxxxx should not time out, or the npm website should let you add a custom deprecation message.
Steps To Reproduce
This takes about seven minutes to run:
% npm deprecate ipfs "js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details" --otp xxxxxx <--- first OTP
This operation requires a one-time password.
Enter OTP: xxxxxx <--- second OTP
npm ERR! code EOTP
npm ERR! This operation requires a one-time password from your authenticator.
npm ERR! You can provide a one-time password by passing --otp=<code> to the command you ran.
npm ERR! If you already provided a one-time password then it is likely that you either typoed
npm ERR! it, or it timed out. Please try again.
npm ERR! A complete log of this run can be found in: /Users/alex/.npm/_logs/2023-05-30T08_23_02_461Z-debug-0.log
Log file:
% cat /Users/alex/.npm/_logs/2023-05-30T09_02_07_416Z-debug-0.log
0 verbose cli /Users/alex/.nvm/versions/node/v18.16.0/bin/node /Users/alex/.nvm/versions/node/v18.16.0/bin/npm
1 info using npm@9.6.7
2 info using node@v18.16.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/Users/alex/.nvm/versions/node/v18.16.0/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/alex/Documents/Workspaces/ipfs/js-ipfs/packages/ipfs/.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:/Users/alex/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/Users/alex/.nvm/versions/node/v18.16.0/etc/npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 7ms
17 timing npm:load:configload Completed in 7ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm deprecate ipfs js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details
21 verbose argv "deprecate" "ipfs" "js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details" "--otp" "xxxxxx"
22 timing npm:load:setTitle Completed in 6ms
23 timing config:load:flatten Completed in 1ms
24 timing npm:load:display Completed in 1ms
25 verbose logfile logs-max:10 dir:/Users/alex/.npm/_logs/2023-05-30T09_02_07_416Z-
26 verbose logfile /Users/alex/.npm/_logs/2023-05-30T09_02_07_416Z-debug-0.log
27 timing npm:load:logFile Completed in 4ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 19ms
31 silly logfile start cleaning logs, removing 1 files
32 silly logfile done cleaning log files
33 http fetch GET 200 https://registry.npmjs.org/ipfs?write=true 1805ms (cache updated)
Environment
- npm: 9.6.7
- Node.js: 18.16.0
- OS Name: Mac OS
- System Model Name: Macbook Pro
- npm config:
; "user" config from /Users/alex/.npmrc
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /Users/alex/.nvm/versions/node/v18.16.0/bin/node
; node version = v18.16.0
; npm local prefix = /Users/alex
; npm version = 9.6.7
; cwd = /Users/alex
; HOME = /Users/alex
; Run `npm config ls -l` to show all defaults.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing npm deprecate against a package with a large packument and inspect the request timing shown in the supplied npm debug log. Trace the CLI path for the deprecate command and determine what allows the operation to finish before the provided OTP expires; done means the command completes successfully without requiring a replacement OTP.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100