-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
npm install --workspaces runs scripts defined in the package.json file of the parent package and ignores scripts in the package.json files of the workspace packages. The scripts are in order:
- preinstall
- install
- postinstall
- prepublish
- preprepare
- prepare
- postprepare
Expected Behavior
npm install --workspaces should run scripts defined in the package.json files of the workspace packages, not those defined in the parent package.json.
Steps To Reproduce
Create a package with these two files:
./package.json
{
"scripts": {
"install": "echo INSTALLING PARENT"
},
"workspaces": [
"./child"
]
}./child/package.json
{
"scripts": {
"install": "echo INSTALLING CHILD"
}
}Run npm install --workspaces. This will output "INSTALLING PARENT" instead of "INSTALLING CHILD".
Environment
- OS: ubuntu-latest
- Node: 16.6.0
- npm: 7.19.1
hpohlmeyer, dormammun and hirasso
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release