Is there an existing issue for this?
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
Is there an existing issue for this?
Current Behavior
npm install --workspacesruns 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:Expected Behavior
npm install --workspacesshould 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