-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
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
When using a private npm registry, such as Artifactory, the registry may redirect clients to a pre-signed S3 download link when attempting to download a package. During the install process, the progress bar appears to hang for several minutes at the end. Without the progress bar, install times are as expected. My guess is that it might have something to do with the length of the s3 links (they are much longer than npmjs and regular artifactory links).
The progress bar will stay in this state for several minutes:

For both processes the package download links and dependencies have already been resolved in package-lock.json, node_modules deleted, and cache cleaned:
npm i ok 02:08:30 PM
added 614 packages, and audited 615 packages in 3m
107 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm i --progress=false ok 02:35:53 PM
added 614 packages, and audited 615 packages in 11s
107 packages are looking for funding
run `npm fund` for details
Expected Behavior
npm install times are comparable to the time it takes when the progress bar is disabled when using registries such as Artifactory
Steps To Reproduce
- Make sure the npm environment is clean by deleting node_modules and running ‘npm cache clean --force’
- Configure the npm registry to a registry that redirects package downloads to pre-signed s3 links.
- Run npm install
Environment
- npm: 8.19.3
- Node.js: 16.16.0
- OS Name: Ventura 32GB
- System Model Name: MacBook Pro Apple M1 Max
Also reproduced on Ubuntu 20.04 with npm 8.19.3 - npm config:
; "user" config from /Users/xx/.npmrc
//xxxx/artifactory/api/npm/my-npm/:_authToken = (protected)
progress = true
registry = "https://xxxx/artifactory/api/npm/my-npm/"
; node bin location = /Users/xx/.nvm/versions/node/v16.16.0/bin/node
; node version = v16.16.0
; npm local prefix = /Users/xx/packages/my-npm-package
; npm version = 8.19.3
; cwd = /Users/xx/packages/my-npm-package
; HOME = /Users/xx
; Run `npm config ls -l` to show all defaults.