-
Notifications
You must be signed in to change notification settings - Fork 80
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Npm3 problems #28
Comments
Thanks for reporting. I don't recall having any optimizations in place for that dependency. Do you know what would fix this issue? |
Well, Where is the resolution logic, maybe I could take a look? |
Maybe use https://github.com/substack/node-resolve which allows us to set a basedir? If you currently use |
The dependency-tree module doesn't use lodash.assign directly. I can't find its usage in any of the dependencies either. Does your shrinkwrap fail? Or is it that the deduping isn't as good as it could be? Also, how did you gather that dependency-tree is involved? |
Yeah, that's it. Digging down into |
I'm open to using node-resolve instead if that'll fix the issue. Sadly, passing along a baseDir will involve having both Is there an easy workaround? |
Try |
@SimenB may I ask, what are you using dependency-tree for? Curious as to its applications outside of the stuff I've written. |
It does work now, thanks! |
To answer your question, we currently have a mock version of our Spring app running on express, which is used for front end development. But the same version is also bundled up for usage as a demo from a memory stick. When we bundle it, we want to avoid adding development dependencies to the tar ball, so we use dependency-tree to get only the actual dependencies and zipping it up in one file. |
@SimenB that sounds pretty cool. Might be interesting to have http://rollupjs.org/ use dependency-tree to support commonjs and amd apps. |
We tried webpacking it, but native dependencies messed up when in a single file (logically, I suppose). But dependency-tree works good for us, just using archiver to add the deps we get, just deduping them and messing with the strings to get relative pathing, to a zip. |
Bad title, but I think that's the reason. 馃槅
Let's see if I can explain what (I think) is happening:
We have a dependency on
yargs
, which depends onyargs-parser
, which useslodash.assgin@4
. We also usebabel-eslint
, which useslodash.assign@3
.lodash.assign@4
has dependencies onlodash.rest
andlodash.keys
, whilelodash.assign@3
has dependencies onlodash._baseassign
,lodash._createassigner
andlodash.keys
.npm@3
putslodash.assign@3
andlodash.rest
in my projectsnode_modules
, but keepslodash.assign@4
inyargs-parser
'snode_modules
.Now, the problem:
dependency-tree
references thelodash.assign@3
in my project'snode_modules
, instead of the right one foryargs-parser
.I think you have an optimization which says "oh, lodash.assign is already added, moving on", instead of handling the fact that multiple versions are installed.
Do you understand the error, or should I try to create a reproducible sample?
The text was updated successfully, but these errors were encountered: