Skip to content

[BUG] All workspaces require script during npm run * --workspaces #3043

@krpeacock

Description

@krpeacock

Current Behavior:

I have a package with three workspaces - 2 packages, and a directory with end-to-end tests depending on them.

Currently, if my packages have a build script, I would like to run npm run build --workspaces. If my e2e workspace doesn't have a build script, the command fails. My workaround is that I have to add a blank "build": "" script to enable that, and to do the same for any other command I'd like to run in multiple but not all workspaces.

Expected Behavior:

npm run * --workspaces will run the command in every package that has that script, and will ignore packages without that script.

Steps To Reproduce:

Environment:

OS: Mac 10.15.7
npm: 7.8.0
node: v14.15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions