`lerna bootstrap` tries to build dependency in the wrong order, so dependent build fails
See original GitHub issueIt appears that lerna links a local project A into a local project B, but does not run the build
step of project A before it tries to build project B, so project B’s build fails because it can not resolve the modules from project A because it does not have its dist folder.
Expected Behavior
Lerna should build A before B.
Current Behavior
Lerna doesn’t, and so B’s build fails.
Possible Solution
Steps to Reproduce (for bugs)
git clone --recursive git@github.com:infamous/umbrella.git
cd umbrella
git checkout lerna-issue-2453
lerna bootstrap
lerna.json
{
"packages": ["apps/*", "packages/*"],
"version": "independent"
}
lerna-debug.log
None.
Context
I was trying out lerna for the first time in an existing repo that has multiple projects. Each project is a git submodule.
Could the fact that the projects I have in apps/*
and packages/*
are git submodules be throwing of Lerna’s build algo?
Your Environment
Executable | Version |
---|---|
lerna --version |
3.20.2 |
npm --version |
6.13.6 |
yarn --version |
N/A |
node --version |
13.8.0 |
OS | Version |
---|---|
Manjaro Linux | rolling release |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:11
Top Results From Across the Web
Using Lerna with unpublished packages - Stack Overflow
Whenever lerna cannot match a dependency to a local package, it'll try to install it from the registry. So ensure that the dependency...
Read more >Getting Started | Lerna
The dependencies will be rebuilt only when they change. Otherwise, their dist folders will be kept as is.
Read more >Error Codes | Yarn - Package Manager
A list of Yarn's error codes with detailed explanations. ... Indeed, in order to build a package, we first must make sure that...
Read more >Things I wish I had known when I started JavaScript monorepo ...
Lerna will find out which packages have build npm script defined and then it determines their order of execution. The order is determined...
Read more >Create a monorepo with Lerna | by Damian Cyrus - Medium
The command lerna bootstrap installs all dependencies within all ... if you are depending on another package and if that needs to be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is what I’ve been using successfully for the last years to run
prepare
scripts in the right order: https://gist.github.com/ShishKabab/51ae7b6aab9292f865de0ee238c26052So, is there a workaround for this issue? I’m manually installing and building the “primitive” packages first and then running
yarn lerna bootstrap
to build all packages without problems. 😢