Skip to content

yarn audit does not work in a monorepo if the root does not contain name and version #6734

Description

@rally25rs

Do you want to request a feature or report a bug?

🐞

What is the current behavior?

If using yarn audit from a monorepo, if the root package.json does not have name and version fields, then the npm audit API will return an HTTP 500.

If the current behavior is a bug, please provide the steps to reproduce.

Make a monorepo with no name and version in the root package.json and run yarn audit

This is related to #6611 but where the monorepo root is missing the fields instead of individual packages. Since the monorepo root isn't really a publishable npm package, we shouldn't assume that it would have to have a name and version.

What is the expected behavior?

Since the npm API seems to require name and version, yarn should probably add something as a placeholder for the API call, even when it is missing from the monorepo package.json.

Please mention your node.js, yarn and operating system version.

1.12.3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions