npm install based on node engine version #3662
Comments
Sounds like a good feature regarding backwards-compatibility. However, as you proceed with development and don't keep that compatibility forever, you should consider publishing the < 0.11.0 code as distinctive version and tell your users from there on to install the module using a version identifier for the sake of compatibility (module@2.1.0). Every normal user who goes with time (standard $ npm install module) will get the latest version. Also, it's far more maintainable. |
The development pattern I had in mind was to create minor versions of my own, and keep those compatible with specific minor versions of Node. (e.g. my |
Agreed, a selector-based approach would ease up the process a bit. Let's hear some different voices before it's implemented. |
I think this is feature bloat On Tuesday, July 16, 2013, Kenan Sulayman wrote:
|
On Jul 16, 2013 5:10 PM, "Luke Arduini" notifications@github.com wrote:
Could you elaborate why? node-gyp already does something similar by detecting what version of Node Also I'm seeing developers ifdef'ing their code up the yin yang to support At the very least it'd help to have a quick way of finding out which |
This is already in npm, behind a flag: The reason that's false by default is that it made life unnecessarily difficult going from 0.6 to 0.8. I think we can maybe get away with defaulting this to true for packages that have a Another approach might be to say that it's strict by default, but only starting with Node 0.10. That is, if Node 0.6.0 would satisfy your requirement, then any version of Node <= 0.10 is accepted. Of course, then this is not only just magical, but a liar, which is pretty bad. A third option is to make it strict by default, since no one uses this very much any more, as it's no longer the default in What do you folks think? |
@isaacs making it strict would certainly necessitate a new major npm version, for one. I've seen people doing full x.y.z engines values, though. That's not a huge problem, but it's worth taking into account. |
Basically, I'd like to figure out a way that it prevents people trying to install binary addons that just won't work, but also doesn't encourage people saying that their little javascript lib only works with version 0.10.13-pre of Node. |
On Jul 18, 2013 7:45 PM, "Isaac Z. Schlueter" notifications@github.com
Well since native module developers are generally a small subset IMO we Since node-gyp does its little install magic building based on the version I do understand the implications of developers not setting their engines |
attempt to fix build on Node 0.8, where NPM was attempting to install Bower 1.3.8, which is incompatible npm/npm#3662 (comment)
👍 for my application specifies a dependency as |
Since there was last serious discussion on this feature request, the CLI team has removed To me, this feels like a problem that's external to npm itself, because it moves beyond the SemVer range-matching at the core of the install algorithm, and forces the installer to take into account other factors. The way this is done in practice right now is ad hoc scripts (like those used by the I'm not opposed to integrating this functionality on principle, but it brings a set of concerns that are more familiar to me from OS distribution package managers than language-based package managers like npm, and the amount of complexity it adds is somewhat daunting, if you want to avoid |
@othiym23 There are really only one of two ways I see it working exactly as I'd like. Either devs properly list supported module versions (which has shown not to be the case) or npm runs a giant test farm to test modules against all supported versions of node and catalogs which do/don't. Don't see either happening. So how about a |
We're closing this issue as it has gone thirty days without activity. In our experience if an issue has gone thirty days without any activity then it's unlikely to be addressed. In the case of bug reports, often the underlying issue will be addressed but finding related issues is quite difficult and often incomplete. If this was a bug report and it is still relevant then we encourage you to open it again as a new issue. If this was a feature request then you should feel free to open it again, or even better open a PR. For more information about our new issue aging policies and why we've instituted them please see our blog post. |
That is a very interesting way of increasing issue-resolve KPIs. |
Tried posting this to the mailing list, but it was being a bastard.
Because of the complex changes to the v8 API recently I was thinking it would be nice to allow "npm install" to automatically install the latest version of the package based on the latest supported node engine.
This way I could maintain two branches of my project, One could have something like
and the other
publish each of those to different minor versions, and npm could figure out which minor version to use automatically based on what version of node I'm using to get the package.
Feasibility for a feature like this?
The text was updated successfully, but these errors were encountered: