Skip to content

[BUG] NPM doesn't allow me to 'npm i' on even slightly weak network connections #4430

Open
@okirpane

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 I run npm i on my computer (Macbook Pro 2020) with a 5G internet connection that drops packages every now and then, the command hangs at larger packages.
Basically:

  • I run npm i
  • It downloads a few packages
  • It reaches a package that is slightly big
  • Then just... stops.
  • I have to then CTRL+C in the terminal to quit the process and find a more consistent network connection.

Expected Behavior

I would expect my package manager to at least work when my connection wavers a little. The fact that NPM just fails completely is dissapointing.

Steps To Reproduce

  1. Connect to a slightly unstable network connection
  2. Start a project with some node_modules
  3. Run npm i
  4. Observe that it hangs when it reaches a large package.

Environment

  • npm: npm 8.3.0
  • Node.js: Node.js v16.11.0
  • OS Name: MacOS Monterey 12.2.1
  • System Model Name: Macbook Pro 2020
  • npm config:
; "builtin" config from /opt/homebrew/lib/node_modules/npm/npmrc

prefix = "/opt/homebrew" 

; "project" config from /Users/okirp/Desktop/ojasvin/.npmrc

engine-strict = true 

; node bin location = /opt/homebrew/Cellar/node/16.11.0/bin/node
; cwd = /Users/okirp/Desktop/ojasvin
; HOME = /Users/okirp
; Run `npm config ls -l` to show all defaults.

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions