-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm install --workspaces runs scripts in parent package #3598
Comments
Not sure if it's a feature or bug. Ironically, I'm here for the opposite problem. |
This is not only a problem if you run
It should be a bug, it is written down in the RFC, but the implementation does not match the RFC:
And to add some more info to the issue, here is our problem with the current behavior: We have a monorepo with three workspaces:
Our backend uses prisma and generates the prisma client in a postinstall hook. So Locally everthing works fine, but we the problems start in our CI scripts. If we want to deploy the frontend we run |
I just found a comment from @fritzy in another issue:
I am not sure if this comment is aimed at running |
Lifecycle scripts aren't even run when calling |
@hpohlmeyer as you quoted in the RFC, it performs the lifecycles scripts of the top-level workspace, not the children. This is working as designed, but if you'd like to change this behavior, please open a discussion in the RFCs repo. Can you create an RRFC in that repo? |
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: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
./child/package.json
Run
npm install --workspaces
. This will output "INSTALLING PARENT" instead of "INSTALLING CHILD".Environment
The text was updated successfully, but these errors were encountered: