-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use package.json fields? #12
Comments
Reading from |
I agree with @ljharb in regards to not reading the local @joshgav - Has the VM neutrality group proposed any kind of standard for identifying which underlying engine should be used? Is |
Okay fair points :). In addition to So let's rephrase this issue as:
AFAIK that group hasn't considered the question, and in fact it might be something for this group to consider. /cc @nodejs/api |
I don't think version managers and installers should concern themselves with package.json - ie, with per-project anything. As far as "underlying engine" - I assume you mean v8 vs chakra vs spidermonkey, etc. I think this is something we should try to think about, so we aren't designed into a corner - but not something we should try to tackle for awhile. |
One could argue, however, (1) that at least since npm is distributed side by side with node, they're somewhat entangled. And, (2) since any serious node project already has a package.json it would not be totally unrealistic to read its engines field, rather than introduce a new file. I also don't think that implementation simplicity should be a priority over user experience, even more as reading JSON, is usually not too hard. |
No doubt npm & node are somewhat entangled, but it's still not safe to assume npm is always present. For example, the original Alpine Docker images came in two flavors, one of which has npm and another without. The point is people do think about NOT using npm (to the tune of several million downloads of those images). I actually know of alot of apps that don't use a package.json file, mostly for embedding in network appliances (routers, A/V equipment, etc). They leverage version managers to take advantage of things like security patches in node itself, but their scripts don't change. These are mostly proprietary and aren't as visible... won't be on Github anytime soon. This is a harder market to get any insights into. As I mentioned before, this is probably a pretty distinct minority, but still something to consider. @ljharb - yeah, "underlying engine" was referring to Chakra/Spidermonkey/etc. The VM working group seems to be actively moving towards an agnostic API to make engine selection easier. I sensed some level of urgency from the VM group, but I haven't kept up to know if it's something we need to worry about now or if it was just enthusiasm from everyone being in the same room at the same time :-) |
The API WG will be shipping the agnostic C API behind a build flag in Node 8. I've seen various Ruby version managers use a |
Ah, thanks. Missed that. Mostly just came here to mention the C API stuff. 😸 |
ps-nvm does exactly this :) |
So, I'm closing this as a "no". |
Sharing for future reference: nodenv supports Personally, I do not use the plugin. I have found that most projects which do specify |
Some installers and tools attempt or would like to use the package.json
engines
field to select a Node version, see here, here and here.Should a version manager use fields from package.json, and if so which ones and in what ways?
NB: Originally I suggested that this group document all of package.json, but thought better of it per the first few comments below.
The text was updated successfully, but these errors were encountered: