-
Notifications
You must be signed in to change notification settings - Fork 3k
Optional devDependencies? #3870
Comments
Ping? This would be very useful; for the same reason we need |
This is not a terrible idea, but I need to think about how we might add something like this without it getting unwieldy and confusing. Also I don't really like |
Maybe something like this would look better: {
"dependencies": {
"foo": {
"version": ">= 1.2.3",
"optional": true,
"dev": true
}
}
} |
The name may look a little weird but it's a direct equivalent of |
@rlidwka Having a firm grasp of what the version distribution of the CLI is for npm users, I am confident that if we made that change, the entire npm community would be inadequate to handle the resulting deluge of support tickets. That is a huge breaking change and isn't going to happen. @mzgol It is a direct equivalent, and that's part of why I'm uncomfortable with this whole concept. There are too many property names including |
@rlidwka To clarify the breakingness of the change: This'd be easy to implement in a backward compatible fashion but impossible to do in a forward compatible fashion. As such, users of older versions of npm wouldn't be able to install these modules. Given how slow people are to upgrade npm, forward compatibility is actually more troublesome than backward compatibility. |
Add an ability to do this first, then in a couple of years when people are all using npm that supports it, newer syntax will gradually replace older one. In fact I am thinking about forward compatibility in the future. Now we have |
I need this. I have a test dependency that will fail to install on particular versions of node/io.js, that'll cause TravisCI to report failures. :( |
So honestly I think the software lifecycle modeled by npm's current feature set (dev and prod), while adequate for many use cases (especially small modules), is frequently inadequate for applications. My bikeshed opinion here would be consider a rethink that acknowledges use cases such as:
So another way to think of this is some of my applications have lifecycles that include development, optional development, test, build, and run (production). Thus my overall thought would be allow more flexible grouping/categorizing of deps so I can express this. My first thought would be tagging them as below but clearly a lot of thought/iteration would be required.
The cli would need to accommodate this something like Just food for thought. Given the implications, I'm not holding my breath for any traction on this. |
This has been moved to the npm roadmap, which we're using instead of the confusing |
msgpack removed as it fails on iojs. optionalDependencies is not an optionalDevDependencies. npm/npm#3870
(Just to add a data point: I use fuse-bindings-dependent package in my dev workflow, which is likely to not install properly on non-Linux platforms. Right now, I'm just not listing it in my package.json at all, since I don't want to burden all users with failure messages for unneeded packages during install. As long as we have the current schema for dependencies, |
It's not available on windows, so it's breaking CI testing there. optionalDevDependencies is not a real key (yet), see npm/npm#3870 You have to manually install in the meantime.
It's not available on windows, so it's breaking CI testing there. optionalDevDependencies is not a real key (yet), see npm/npm#3870 You have to manually install in the meantime.
The CLI team just had a fairly extensive discussion that covered both the idea of reworking how
So, I’m going to close this issue because this isn’t something the CLI team intends to implement. That said, I think that eventually some version of npm should really get around to unifying the various kinds of dependencies, and also everybody’s input on this issue was very valuable. Thanks to all for their time. |
I'm not sure if this actually makes a difference, though. See the following issues for more info: * npm/npm#3870 * npm/npm#2679
I would like a way to specify optional devDependencies, ie. devDependencies that doesn't cause an error if they're not found.
The text was updated successfully, but these errors were encountered: