Hacker News new | ask | show | jobs
by randallsquared 3604 days ago
Given that in npm v3 the order of installation determines where things are installed, this seems like it might cause some interesting bugs that never happen on the developer's machine. :)
2 comments

I'm not sure how this could happen as one shouldn't be depending on the directory structure in the node_modules/ folder anyway. Do you have an example of where this might cause issues?
Well, one shouldn't... :)

I don't actually know that there's any problem that `rm node_modules; npm install` won't solve, since that would make things the same as a fresh install.

All of the scenarios I could come up with were about long-running installs, rather than new deploys, so more likely to happen on dev than prod.

ETA: actually wrong, see below.

I can't think of any scenario when one would be relying on a specific structure being in the node_modules/ directory. And if there is such a need, then it's likely the code is doing something very strange or very special in which case this kind of package would not even be considered during creation (and I still think wouldn't cause problems).

Even in long-running installs I still don't see a potential issue here. Do you have a small specific example you can think of?

Package A depends on lodash: ^4.6.1

Package B depends on lodash: ^4.14.2

... you know what? I just installed semver to check my beliefs, and it turns out I'm just spreading FUD. Caret doesn't work the way I thought it did.

Please disregard.

Wow, I'll have to look that up. Thanks!