npm / npm/cli

[BUG] RUN npm ci --unsafe-perm fails in docker container with https registry - works with http

Open
#5,901 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

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

RUN npm ci --unsafe-perm fails on some Macs when trying to build a docker container. It does work locally. And it does work if changing the registry from https to http for with the docker command RUN npm config set registry http://registry.npmjs.org/

We're unable to determine why that should cause any issue?

There error generated is npm ERR! code ECONNRESET

We are using npm 8.19.3 and Node 16.13.0

Expected Behavior

Docker build files work with npm. (Previously we used yarn and have ported to npm)

Steps To Reproduce
  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...
Environment
  • npm: 8.19.2 and .3
  • Node.js: 16.13.0
  • OS Name: MacOS 12.6.1
  • System Model Name: 2019 MacBook Pro. Docker: mlupin/docker-lambda:nodejs16.x-build-x86_64
  • npm config:
; copy and paste output from `npm config ls` here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Docker build with mlupin/docker-lambda:nodejs16.x-build-x86_64, npm 8.19.3, Node 16.13.0, and the registry switched between HTTPS and HTTP. Inspect the npm config and the ECONNRESET failure during npm ci --unsafe-perm; done means identifying the HTTPS-specific cause and establishing whether the Docker build can complete against the HTTPS registry.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.