Closed
Description
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
Current Behavior
With workspaces, if you try to run all child scripts of name
via a root script of the same name
that uses the dotenv
CLI, it will go into an infinite loop.
For example, in root:
{
"name": "infinte-loop-example",
"version": "0.0.0",
"workspaces": ["a", "b"]
"scripts": {
"build": "dotenv npm run build --workspaces"
}
}
And assuming a
and b
both define their own build
scripts... If you run npm run build
, you'll get an infinite loop:
$ npm run build
> infinte-loop-example@0.0.0 build
> dotenv npm run build --workspaces
> infinte-loop-example@0.0.0 build
> dotenv npm run build --workspaces
> infinte-loop-example@0.0.0 build
> dotenv npm run build --workspaces
> infinte-loop-example@0.0.0 build
> dotenv npm run build --workspaces
Expected Behavior
No infinite loop, and the a
and b
workspace build
script is run.
Steps To Reproduce
See above.
Environment
- npm:
8.19.2
- Node.js:
18.11.0
- OS Name: macOS