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
Lerna does not strip local packages from bundledDependencies
in tempJson
#1775
Lerna does not strip local packages from bundledDependencies
in tempJson
#1775
Comments
This seems to be a regression because lerna |
Is there any workaround for this? |
@rix0rrr Yes, this is a "regression" in the sense that lerna 2.x half-obliterated the original package.json, only preserving @mikea Short of not using |
In terms of a fix, filtering out local package names should be inserted here, before the dependency range filter loops. Since // remove local dependencies from bundledDependencies, otherwise `npm install` breaks
if (json.bundledDependencies) {
json.bundledDependencies = json.bundledDependencies.filter(depName => depMap.has(depName));
} |
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. |
When trying to bundle local (private) dependencies into another package,
package.json
looks like this:During
lerna bootstrap
, lerna rewrites this to:Which causes the
npm install
to fail, sincelocal-dep
does not exist up on NPM. Correct behavior would have been to remove the local package frombundledDependencies
as well.The bug does not show with packages that have been published to NPM, because they will be installed as normal and then the downloaded package is replaced with a symlink by
lerna link
later on, but there is no recourse if you do not want to publish the package to NPM (or if you need your Lerna build to pass first on the CI server before the publish to NPM will happen).Reproduction
Package contents here: https://gist.github.com/rix0rrr/a05bd6b30e5364401cddce7bd6efe129
The text was updated successfully, but these errors were encountered: