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 link convert → forced bad hoisting; bad file: refs #1419
Comments
Still hoisting in 3.0.0-beta.21. |
sorry for the lack of docs |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
With Lerna 3.10.6, running Hoisting the packages' dev dependencies out of their package.json files also hoisted e.g. As an unexpected consequence of using Not really happy with this command. I tried making it work for a while, but ended up rolling back my changes. In case it matters, the packages in this repo are all scoped. |
Yeah, I guess I never accounted for the "use local devDependencies to influence topological sort" case. Seems like maybe that loop should be aware of "am i local or not". TBH, I don't think that's a very useful trick, as it is completely ignored during If you're using relative As for node-sass, that sounds like a tool that isn't using node's module resolution algorithm correctly. FWIW, |
To clarify, the dev dependency in my case isn't a tool, but one package's built output that gets copied into and released as a part of another package. Therefore it's a dev (build-time) dependency, rather than a runtime dependency. In part this is needed to match the package's pre-monorepo structure, but it also makes node-sass much easier to use as its v5 release seems to be dragging on for quite some time. Is this the right issue to also track the problems caused by the loss of package-specific |
Ah, ok. Interesting. The lack of local bins (or at the very least, local bin resolution) is a somewhat distinct issue. I've been noodling about it, probably need a root postinstall |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@evocateur have you given any thought to adding that Also thanks for all the support you've given to this I know it's tough to do open source work and this really helps. |
After running
lerna link convert
with 3.0.0-beta.20:hoist: false
package.json
to each package in the monorepo, which might have been intendedfile:../pkgname
, which was definitely not intended as the path should have beenpkg/pkgname
I wouldn't raise bugs against this behaviour if it were unreleased, but it's on
npm
and @evocateur is recommending people upgrade to work around other problems e.g. #1418, which is close enough to released that I figure it's worth the effort.Expected Behavior
hoist: false
file:
references point to a valid pathCurrent Behavior
hoist: false
file:
references to packages in the monorepo are invalid at the top levelSteps to Reproduce (for bugs)
With node 8.11.1 and npm 5.6.0 (e.g. under the prompt you get from
docker run node:8
):Note:
tap
added to the top leveldevDependencies
tap
removed fromdevDependencies
inpkg/one/package.json
tap
removed fromdevDependencies
inpkg/two/package.json
file:../pkgname
problem, but submit the rest as proof-of-effortlerna.json
Context
We're still having trouble driving our monorepo with
lerna
, particularly around version management and preparing deployment packages:Having to update every dependent's
package.json
to reflect minor and patch bumps spams our diffs, and things get awkward if we miss one.--force-local
might help, here, while hurting us if it masks us forgetting a major bump.If you want to prepare a deployment package without first publishing everything to
npm
, it seems obvious that all you need to do is set up a deployment package in the monorepo. Win! Now, try to get only the files you need for production intonode_modules
. Lose!I was hoping I could solve the deployment problem by jamming paths into the version fields on my dependencies to get
npm install --production
inpkg/whatevs-deploy
to prepare a localnode_modules
without symlinks for deployment, but hit annpm
bug.While researching the above, I tripped over #1418, which raised my hope that a
lerna
update might help us out. It didn't.PS this is an awesome question to put in your issue template. Good on you.
Your Environment
macOS and Linux
lerna --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: