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] npx --version takes >3 seconds to execute on windows #7206

Closed
2 tasks done
BeatsuDev opened this issue Feb 6, 2024 · 1 comment
Closed
2 tasks done

[BUG] npx --version takes >3 seconds to execute on windows #7206

BeatsuDev opened this issue Feb 6, 2024 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@BeatsuDev
Copy link

BeatsuDev commented Feb 6, 2024

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

Running any npx command takes over 3 seconds on my laptop.

Here's a timing from WSL:

$ time (npx --version > /dev/null)

real    0m3.103s
user    0m0.028s
sys     0m0.084s

This happens outside of WSL as well.

Here are the logs from npx --version --verbose:

0 verbose cli C:\Users\ericb\AppData\Roaming\nvm\v21.6.0\node.exe C:\Users\ericb\AppData\Roaming\nvm\v21.6.0\node_modules\npm\bin\npm-cli.js
1 info using npm@10.2.4
2 info using node@v21.6.0
3 timing npm:load:whichnode Completed in 9ms
4 timing config:load:defaults Completed in 6ms
5 timing config:load:file:C:\Users\ericb\AppData\Roaming\nvm\v21.6.0\node_modules\npm\npmrc Completed in 7ms
6 timing config:load:builtin Completed in 7ms
7 timing config:load:cli Completed in 8ms
8 timing config:load:env Completed in 1ms
9 timing config:load:project Completed in 4ms
10 timing config:load:file:C:\Users\ericb\.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:C:\Users\ericb\AppData\Roaming\nvm\v21.6.0\etc\npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:setEnvs Completed in 3ms
15 timing config:load Completed in 32ms
16 timing npm:load:configload Completed in 33ms
17 timing config:load:flatten Completed in 6ms
18 timing npm:load:mkdirpcache Completed in 1ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm exec
21 verbose argv "exec" "--version" "--loglevel" "verbose"
22 timing npm:load:setTitle Completed in 2ms
23 timing npm:load:display Completed in 12ms
24 verbose logfile logs-max:10 dir:C:\Users\ericb\AppData\Local\npm-cache\_logs\2024-02-06T23_29_31_415Z-
25 verbose logfile C:\Users\ericb\AppData\Local\npm-cache\_logs\2024-02-06T23_29_31_415Z-debug-0.log
26 timing npm:load:logFile Completed in 33ms
27 timing npm:load:timers Completed in 0ms
28 timing npm:load:configScope Completed in 0ms
29 timing npm:load Completed in 163ms
30 verbose exit 0
31 timing npm Completed in 183ms
32 info ok

It doesn't seem to add up to 3 seconds...

Expected Behavior

At least sub-second execution time for simple commands like --version and --help.

Steps To Reproduce

In command prompt run npx --help. Observe that it takes over 3 seconds to execute.

Environment

  • npm: 10.2.4
  • Node.js: 21.6.0
  • OS Name: Windows 11
  • System Model Name: 82R3
  • npm config:
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v21.6.0
; npm local prefix = C:\Users\ericb
; npm version = 10.2.4
; cwd = C:\Users\ericb
; HOME = C:\Users\ericb
; Run `npm config ls -l` to show all defaults.
@BeatsuDev BeatsuDev added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Feb 6, 2024
@BeatsuDev BeatsuDev changed the title [BUG] npx really slow on windows [BUG] npx --version takes >3 seconds to execute on windows Feb 6, 2024
@milaninfy
Copy link
Contributor

PR #7271 improves execution time of npx --version command

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 10.x
Projects
None yet
Development

No branches or pull requests

2 participants