Skip to content
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

[BUG] npm install does not run prepare scripts of workspaces except for root #3840

Closed
1 task done
trusktr opened this issue Oct 6, 2021 · 2 comments
Closed
1 task done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@trusktr
Copy link

trusktr commented Oct 6, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Related issues that were considered fixed, but the issue seems to persist or have regressed:

Current Behavior

npm install does not run prepare scripts of workspaces except for the root workspace.

Expected Behavior

It should run prepare of all workspaces.

Steps To Reproduce

Reproduction repo comparing it with lerna: https://github.com/trusktr/npm-workspaces-vs-lerna

Steps:

git clone https://github.com/trusktr/npm-workspaces-vs-lerna.git
cd npm-workspaces-vs-lerna
npm install
npx lerna bootstrap

Notice that the npm install command runs prepare only for package a, while the npx lerna bootstrap command runs it for all three packages a, b, and c.

Environment

  • OS: Linux
  • Node: 14.16.1
  • npm: 7.24.2
@trusktr trusktr added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 6, 2021
@trusktr
Copy link
Author

trusktr commented Oct 8, 2021

I was trying to see if I could move from Lerna to npm for multi-package management, but this is currently a blocker.

lukaswagner added a commit to lukaswagner/csv-parser that referenced this issue Jan 17, 2022
- Add np for easier publishing
- Add .np-config.json to configure permanent np options
- Add build script as prepare step. Due to a bug with npm, this is currently only appied during publish, but not install: npm/cli#3840
@nlf
Copy link
Contributor

nlf commented Oct 3, 2022

i'm unable to reproduce this with the latest npm@8. i think what might be happening here is that the effect of scripts running in the background is that you're unable to see that the scripts are actually running. by running npm install --foreground-scripts i'm able to see all of the echo statements

i'm going to close this, but please feel free to reopen if you can still reproduce this in the latest npm@8

@nlf nlf closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants