[BUG] npm version
fails when using --include-workspace-root
with no root package.json name
#5580
Closed
2 tasks done
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 8.x
work is associated with a specific npm 8 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Running
npm version <inc> --include-workspace-root --workspaces
throwsnpm ERR! Cannot read properties of undefined (reading '0')
if the workspace root doesn't have aname
field in its package.json.Expected Behavior
The
version
command should not throw an error if the workspace root doesn't have aname
field.Steps To Reproduce
package.json:
packages/one/package.json:
Running
npm version minor --include-workspace-root --workspaces
gives the following error:Upon adding a
name
field to the workspace root, the command succeeds:package.json:
npm version minor --include-workspace-root --workspaces
:Environment
The text was updated successfully, but these errors were encountered: