Skip to content

16.14.2 ships with buggy npm #42397

Description

@haggholm

Version

v16.14.2

Platform

Linux glaurung 5.15.23-76051523-generic #202202110435164495230021.10~96763f1 SMP Tue Feb 15 19:52:40 U x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

In a Yarn monorepo,

yarn workspace some-workspace test

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior?

Tests should run

What do you see instead?

From a test script,

Error: Command failed: npm root -g
npm ERR! Workspaces not supported for global packages

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/petter/.npm/_logs/2022-03-19T01_58_39_948Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:399:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'npm root -g'
}

Additional information

This is a known bug in npm as of 8.5.0, fixed in npm/config#47

It’s resolved as of 8.5.5, but because Node 16.14.2 ships with the broken 8.5.0, it means it affects default nvm installs and anything that (like Github actions we rely on) can respect .nvmrc but offer no place to specify --latest-npm.

Releasing a Node 16 version with a newer npm should resolve the issue, I expect.

Activity

  1. added
    npmIssues and PRs related to the npm client dependency or the npm registry.
    on Mar 19, 2022
  2. Trott commented on Mar 19, 2022

    @Trott
    Member

    Fixed in 76d85a8 which will make it's way to a 16.x release at some point.

  3. haggholm commented on Mar 21, 2022

    @haggholm
    Author

    Fixed in 76d85a8 which will make it's way to a 16.x release at some point.

    👍 Good to hear. Is there any way to get a sense of when “some point” will happen? I realise it sounds self-serving (of course I think that the bug I reported needs a release, being Special); but it genuinely seems to me that pulling the latest image and running yarn may be a very common action in CI pipelines etc. for many people.

  4. Trott commented on Mar 22, 2022

    @Trott
    Member

    Is there any way to get a sense of when “some point” will happen?

    It looks like it will go out in 17.8.0 some time in the next 48 hours (if all goes according to plan). #42425

    From there, it's usually another 2 or 3 weeks before it shows up in an active LTS release, but it can be faster or slower than that depending on various factors. (If someone on the releasers team wants to chime in and provide somewhat more authoritative information, please do!)

  5. BethGriggs commented on Mar 22, 2022

    @BethGriggs
    Member

    The next release is scheduled for 2022-04-05 (nodejs/Release#658). Sometimes we do expedite or do additional interim releases to fix more critical bugs, but that's dependent on releaser's availability.

    /cc @nodejs/npm

  6. Brandons404 commented on Mar 23, 2022

    @Brandons404
  7. XhmikosR commented on Apr 29, 2022

    @XhmikosR
    Contributor

    @Trott I think this can be closed now that v16.15.0 with npm 8.5.5 is out, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    npmIssues and PRs related to the npm client dependency or the npm registry.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions