-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How can I make lerna install devDependencies with "lerna bootstrap --hoist"? #1765
Comments
Ok, so I'm slightly confused but it might make sense too, hear me out. If I have sub packages in my lerna monorepo, and do Update: See my next comment for a better work-around If I however have sub packages just like before, but also install them in the root directory's I guess this is correct? In our case, it doesn't quite help us. We might need to execute some npm command to install devDependencies in each sub package.. I'll update here when we've done it. |
Ok, I found the best possible work-around. Add the packages in the root as "devDependencies". If they are consumed by webpack (like in my case), it doesn't matter if they are in devDependencies, webpack will produce them in the output directory anyway. Here's some discussion about whether it's right or not to use devDependencies. webpack/webpack#520 |
I would just run |
@evocateur I think the bootstrapping is an awesome function. We don't always want to symlink things if we don't consume the latest versions of things, and we have a lot of duplicate dependencies which hoist helps us take care of. Yes, we plan to move the root soon but it's a lot of stuff to move. We have a huge AngularJS app and it's been tricky to transition to micro frontends using lerna, but we're definitely getting there. |
Closing this issue, I feel it's resolved. |
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
#505
Expected Behavior
I'd like to run
lerna bootstrap --hoist
and have each package get their devDependencies installed, either in its own directory or in the root.Current Behavior
devDependencies are ignored.
Possible Solution
Here's a workaround, in the package package.json
"prepare": "if-env lerna=1 && npm install --only=dev || echo 'skipping devDependencies"
actually this doesn't really seem to work either.
Steps to Reproduce (for bugs)
lerna bootstrap --hoist
lerna.json
Context
We have a monorepo where the root project dir is another legacy project.
We therefore don't want to stash all our devDependencies into the project root package.json, because it will generate confusion what belongs where.
Someday we might move the legacy project to a sub package directory, but we can't do that right now.
Your Environment
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: