'Why AzureDevOps private NPM repo is so slow with node 14 and 16?

I upgraded NodeJs to 14 (the same for 16), using NVM on my MacOs, removed package-lock.json and node_modules directory, and ran npm i -verbose, the installation is so slow and it shows (cache stale) for each package, it takes 1 or 2 minutes per package to install. If I revert NodeJs back to 12 or 10, there is no issue.

The following is .npmrc content and I don't want to go HTTP:

registry=https://nintex.pkgs.visualstudio.com/_packaging/<MyCompany>/npm/registry/ 
always-auth=true


Solution 1:[1]

This issue seems to be caused by outdated local cache.

Run npm cache clean --force will clean out the local cache and your npm install should be fast again

https://docs.npmjs.com/cli/v8/commands/npm-cache

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lbsonley