-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
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
> [email protected] build
> dotenv npm run build --workspaces
> [email protected] build
> dotenv npm run build --workspaces
> [email protected] build
> dotenv npm run build --workspaces
> [email protected] build
> dotenv npm run build --workspacesExpected 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
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release