Skip to content

npm 10.4.0 fails "npm install" when using node 18.19.1 and running under slow multi platform ARM build #7231

@tlbdk

Description

@tlbdk

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

We are building our node docker images from this repo:
https://github.com/connectedcars/docker-node

This has been working well until we upgraded to npm 10.4.0, npm 9.8.1 works without issue.

The build is a multi platform(linux/amd64 and linux/arm64) docker build on a linux/amd64 build machine. For the ARM build it consistently fails when using npm 10.4.0 with EPIPE error while fetching different npm packages. The arm64 build is about 10x slower than the amd64 build so this could indicate that we are hitting a race condition of some sort. We also tested on a Macbook Pro M3(linux/arm64) and here we don't see the issue.

#21 [builder 14/16] RUN --mount=type=ssh     --mount=type=secret,id=NPM_TOKEN,uid=1000     secrets2env npm install
#21 298.6 npm ERR! code EPIPE
#21 298.7 npm ERR! syscall write
#21 298.7 npm ERR! errno EPIPE
#21 298.9 npm ERR! request to https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz failed, reason: write EPIPE
#21 299.2 
#21 299.2 npm ERR! A complete log of this run can be found in: /home/builder/.npm/_logs/2024-02-19T12_48_51_863Z-debug-0.log
#21 ERROR: executor failed running [/bin/sh -c secrets2env npm install]: exit code: 1

Expected Behavior

Install packages without errors.

Steps To Reproduce

  1. Build linux/arm64 image on google cloud build amd64 machine (10x slower than normal)
  2. With this package.json https://github.com/connectedcars/docker-node/blob/master/test/package.json
  3. Run 'npm install'
  4. See error 'chore: use the extracted stringify-package module #21 298.6 npm ERR! code EPIPE'

Environment

  • npm:10.4.0
  • Node.js: 18.19.1
  • OS Name: Linux/Docker (Google Cloud Build)
  • System Model Name:
  • npm config:
# Disable npm color output and be less verbose
npm config set color false --global
# Read NPM token from environment variable
npm config set '//registry.npmjs.org/:_authToken' '${NPM_TOKEN}' --global

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions