-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] npm ls
is still slow
#7820
Comments
I'm using npm 11.0.0 and it works fine for me (output: |
TCL 505, Node 23.5.0, : ~ > time npm ls
/data/data/com.termux/files/home
└── (empty)
real 0m4.970s
user 0m4.736s
sys 0m0.975s
~ > time npm ls -g
/data/data/com.termux/files/usr/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
real 0m6.980s
user 0m7.297s
sys 0m1.265s
~ > time node --eval '' # for reference
real 0m0.730s
user 0m0.594s
sys 0m0.124s |
You have the early-release version, as I can tell. Try the 22.x (LTS) one, it should work there. |
@Rudxain checked the isuue what u menioned and the enviroment specified by u . the time taken is ~3s for the specified environment what u mentioned . please provide the detailed information to reproduce the issue |
Note Before I reply to comments, I want to apologize to maintainers for sending too much Termux "benchmarks". I'm aware I should report those issues here. I'll send more Debian benchmarks in some minutes. And I'm aware that the same reasoning applies to Debian, as I've installed Node and NPM from deb repos, not upstream/mainline.
~ > time npm ls
/data/data/com.termux/files/home
└── (empty)
real 0m6.424s
user 0m5.966s
sys 0m0.989s
~ > time npm ls -g
/data/data/com.termux/files/usr/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
real 0m8.625s
user 0m8.174s
sys 0m1.440s
~ > time node --eval ''
real 0m0.779s
user 0m0.612s
sys 0m0.136s
That's odd 😕
`termux-info`
I had to install the new
; "user" config from /data/data/com.termux/files/home/.npmrc
foreground-scripts = true
; node bin location = /data/data/com.termux/files/usr/bin/node
; node version = v23.5.0
; npm local prefix = /data/data/com.termux/files/home
; npm version = 10.9.2
; cwd = /data/data/com.termux/files/home
; HOME = /data/data/com.termux/files/home
; Run `npm config ls -l` to show all defaults. |
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc
globalignorefile = "/etc/npmignore"
prefix = "/usr/local"
; node bin location = /usr/bin/node
; node version = v20.18.1
; npm local prefix = /home/rudxain
; npm version = 11.0.0
; cwd = /home/rudxain
; HOME = /home/rudxain
; Run `npm config ls -l` to show all defaults. rudxain ~ > time npm ls
/home/rudxain
└── (empty)
real 0m1.347s
user 0m1.353s
sys 0m0.274s
rudxain ~ > time npm ls -g
/usr/local/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
real 0m2.226s
user 0m2.338s
sys 0m0.470s
rudxain ~ > time node --eval ''
real 0m0.244s
user 0m0.209s
sys 0m0.034s Note
|
@Rudxain i would avoid using termux with npm, because termux sets |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm/npm#6507
It's slow, both with and without
-g
flag. Even on directories that contain nopackage.json
Expected Behavior
It should be sub ~500ms
Steps To Reproduce
time npm list
(-g
optional)Environment
The text was updated successfully, but these errors were encountered: