0

In most places inside my home directory, npm install and git clone runs very slow, but not in ~/Library. npm install takes tens of minutes in reify stage. While git does not take that long, it takes many times more than in normal folders especially in resolve delta stage.

The most weird thing is that it performs normally in some folders but becomes extremely slow when run in other folders.

Slow folders include ~/Downloads, ~/Desktop, /opt, and ~/repos I created, and normal folders include ~/Library, /tmp, `mktemp -d` and right inside /usr/local.

I tested multiple times in those folders, but the result was the same. It always runs slow in slow folders and always normal in normal folders.

When I first installed the node, there was no problem installing packages or pulling git repo, but after some days, maybe after I installed docker, that weird thing started to happen.

Is there anything that I can try to make npm and git faster everywhere?

I suspect that some antivirus is making file write slow, but I have no third-party antivirus installed. If the builtin antivirus system is causing this problem, I want to exclude some folders or completely disable it.

I have plenty of storage space and it has about 100% of free space.

Memory space might be tight but it cannot explain why it's not slow in some folders.

I have tried granting Full Disk Access to Terminal app, but everything was the same.

node v16.18.2 installed by nvm
npm v8.19.2
MacBook M1 Pro bought days ago
Monterey (not upgrading to Ventura for reasons)

1 Answer 1

1

I just found that Microsoft Defender was installed when I was not noticing, and it was the problem.

I uninstalled it and everything's fine now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .