Closed
Description
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.