When running npm install
in a workspace root, prepare
scripts of individual workspace packages are not run.
The expectation would be that running npm install
in a workspace root would be at least equal to running npm install
in each individual package (ignoring the additional benefits like hoisting for now).
npm install
in the root folder-> All packages have a prepare script that creates a file in their folder, but only the root prepare script is run. When running npm install in a child package the prepare script is run for this child package.
According to the workspaces RFC all dependencies of nested packages should be installed - which is the case - but also all associated lifecycle scripts should be run, which is not the case yet.
A workaround would be to have a top level prepare script which runs the prepare scripts of nested packages, hopefully soon with a run-script
command as detailed in the newer workspaces RFC.
OS: independent
Node: v12.18.4
npm: 7.0.0
Hi @peterjuras, thanks for the report! We do have a patch lined up already and should land hopefully in the next patch release, just want to make sure it gets some more testing prior to landing it 馃槉 I'll keep you posted 馃憤
Thanks for the quick response. I'm looking forward to using npm 7 in more of our repositories.