Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] workspace scripts do not propagate exit codes #6506

Open
2 tasks done
JamesHenry opened this issue May 27, 2023 · 2 comments
Open
2 tasks done

[BUG] workspace scripts do not propagate exit codes #6506

JamesHenry opened this issue May 27, 2023 · 2 comments
Assignees
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@JamesHenry
Copy link
Contributor

JamesHenry commented May 27, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Minimal Setup

package.json

{
  "workspaces": ["child"],
  "scripts": {
    "exit-100": "exit 100"
  }
}

child/package.json

{
  "scripts": {
    "exit-100": "exit 100"
  }
}

Repro Steps

Behavior in root:

npm run exit-100
echo $? # correctly returns 100

Behavior in workspace:

npm run exit-100 --workspace child
echo $? # incorrectly returns 1

# OR

cd child
npm run exit-100
echo $? # incorrectly returns 1

Also note, if you amend the root package.json to remove the workspaces and then repeat those final steps:

cd child
npm run exit-100
echo $? # (now without workspaces config in the level above) correctly returns 100

Environment

  • npm: 9.5.0
  • Node.js: 18.15.0
  • OS Name: macOS 13.3.1
@JamesHenry JamesHenry added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels May 27, 2023
@mehulkar

This comment was marked as off-topic.

@JamesHenry
Copy link
Contributor Author

@mehulkar my guess is you are actually running into #6399 and not what I am describing here

@lukekarrys lukekarrys self-assigned this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

3 participants