Cli: [BUG] npm config get prefix super slow

Created on 4 May 2020  ·  4Comments  ·  Source: npm/cli

What / Why

This is an attempt to resurrect this unresolved bug: https://github.com/npm/npm/issues/14458

For some reason, the command npm config get prefix is multi-seconds slow. This normally wouldn't bother me, but for users of nvm like me, this is really impacting since it uses this command internally, and nvm is used in shell startup scripts. See https://github.com/nvm-sh/nvm/issues/782 for more details. Therefore, shell startup is super slow, especially for those using WSL.

When

Always

Where

NPM CLI

How

Current Behavior

Run time npm config get prefix, see multi-second response timing.

Steps to Reproduce

Run npm config get prefix

Expected Behavior

Result should come back quicker.

Who

?

References

Bug Release 6.x

Most helpful comment

Recently, npm config get prefix has been very slow on my machine. This seems to be ever since I moved the /var/ directory from my SSD to my HDD to free up some space.
The first time the command runs (as part of my .bashrc script) it is especially slow, taking somewhere between 10-20 seconds. Later runs (by opening new shells) it 'only' takes a few seconds.

All 4 comments

cc @darcyclarke; this actually would make a ton of difference for every nvm user, including every travis-ci run.

🤔 I'm positive there's some digging to be done here

Has any progress been made with this? I would be interested in helping with this issue.

Recently, npm config get prefix has been very slow on my machine. This seems to be ever since I moved the /var/ directory from my SSD to my HDD to free up some space.
The first time the command runs (as part of my .bashrc script) it is especially slow, taking somewhere between 10-20 seconds. Later runs (by opening new shells) it 'only' takes a few seconds.

Was this page helpful?
0 / 5 - 0 ratings