Is there an existing issue for this?
This issue exists in the latest npm version
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
Is there an existing issue for this?
This issue exists in the latest npm version
Minimal Setup
package.json
{ "workspaces": ["child"], "scripts": { "exit-100": "exit 100" } }child/package.json
{ "scripts": { "exit-100": "exit 100" } }Repro Steps
Behavior in root:
Behavior in workspace:
Also note, if you amend the root
package.jsonto remove theworkspacesand then repeat those final steps:Environment