-
Notifications
You must be signed in to change notification settings - Fork 10
flex-sdk dependency broken? #5
Comments
I reinstalled nodist and node. My npm is now down to 1.4.6, which doesn't have this issue. |
Yeah... NPM has been having loads of issues with large modules like The general lame "answer" I recall seeing was "make smaller modules". sigh |
Could you point me to the underlying issue(s) though? I couldn't figure out why it basically seemed to think that 4 was less than 3. Thanks! |
Oh, my bad, I honestly didn't read your comment closely enough. Yeah, that's just peculiar and nothing to do with the module size I was mentioning (sorry for the confusion). Turns out it is being caused by newer behavior in npm/node-semver, which is responsible for validating and comparing semver versions... and unfortunately, this update will make the particular Here's the info on how and why they decided to break this existing, straight-forward mechanism: https://github.com/npm/node-semver#prerelease-tags |
Interesting (and pretty annoying). What would be the recommended course of action then? |
Can you try the following on your local system?
This version string should work on both from what I understand... but it is very annoying. 😕 |
Yep, that seems to solve it on both 1.x and 2.x. |
Thanks for verifying, I'll try to release an update for this module tonight then. |
Fixed in |
I just ran into this again with npm v2.1.18, but I can't explain why. If I run I subsequently tried to fix it with
The latter is supposed to mean |
Correct. 😕 Any luck if you update NPM to the latest ( |
I just tried that right after posting the comment. No luck. I also tried the following semver strings with mixed results:
I sense it might have something to do with the Incidentally, the semver docs say |
I thought so but, upon rereading the npm/node-semver @ README.md#prerelease-tags, apparently not. 😕
In other words, There is no good way to write a generic NPM version range for prerelease versions any more. 😞 So... this string will need to be constantly updated, or else we'll have to just put the wildcard ( |
Not so. Space-delimited comparator sets are intersections,
|
Local test: $ node index.js
Does "4.1.0-0" satisfy range expection "^4.0.0-0"? No....
Does "4.1.0-0" satisfy range expection "^4.0.0"? No....
Does "4.0.0-0" satisfy range expection "^4.0.0-0"? YES!
Does "4.0.0-0" satisfy range expection "^4.0.0"? No....
Does "4.0.0-0" satisfy range expection "^4.*.*-*"? No....
Does "4.0.0-0" satisfy range expection "^4.x.x-*"? No....
Does "4.0.0-0" satisfy range expection "^4.x.x"? No....
Does "4.0.0-0" satisfy range expection "^4.*"? No....
Does "4.0.0-0" satisfy range expection "^4.x"? No....
Does "4.0.0-0" satisfy range expection "*"? YES! |
I misread the part about intersections. My bad. Probably too obvious a question: do we really need prerelease versions for this? |
More tests to demonstrate my earlier point about build metadata ( $ node index.js
"4.0.0-0" is less than "4.0.0-1"
"4.0.0-0" is less than "4.0.0"
"4.0.0" is equal to "4.0.0+1"
"4.0.0+1" is equal to "4.0.0+2" |
The reason I—at least previously 😞—preferred to use prerelease versions is that the real version is dependent on the external source (Adobe/Apache's versioning of the Flex SDK). Ideally I would've been able to use "postrelease" ("build metdata", In
In
|
My inclination at this point is just to continue using prerelease versions [to preserve the external versioning scheme] but set the dependency version range in downstream modules like this one ("grunt-mxmlc") to be |
Couldn't you also keep the package version synchronized with the SDK version? That'd be more work, of course. (Also, the Apache version is actually at 4.13.0 while the npm package is at 4.6.0-0, which is confusing.) I guess that, in most cases, the asterisk makes the most sense. It's not as elegant, but yeah, at least it'll work. |
They are synchronized. The latest Node package version (of Apache made a bunch of immediate changes to the Flex SDK before releasing their first version ( |
To clarify, I use the prerelease versioning for when the Node package has issues that require updating. If I didn't, I would publish The preferred alternative is using post-release versioning ("build metadata", $ node index.js
Does "4.0.0+0" satisfy range expection "^4.0.0+1"? YES! (Should be "No....", IMHO)
Does "4.0.0+0" satisfy range expection "^4.0.0+2"? YES! (Should be "No....", IMHO) |
I see. Maybe you could use a hack on semantic versioning with multiples of 1,000? Perl uses this to represent its version number as a float. E.g.:
Alternatively, you could use only the minor version. E.g. 5.4006001.0 would be your first build of Adobe's 4.6.1. The 5 would just be for continuity. Not the most elegant solution either, but at least it would avoid the prerelease madness. |
Actually, my previous mention of switching to post-release ("build metadata", Really, really unfortunate situation. |
How do you feel about the alternative versioning scheme I proposed above? |
I appreciate the info and examples but I am very much not a fan of that alternate scheme. 😣 |
Related open issues filed against the SemVer spec: |
The PhantomJS Node module that wraps PhantomJS went through the same versioning limitations. They eventually just gave up and switched to strictly follow SemVer, resulting in fewer dependency version selection issues (like this one) but also confusing their users. 👎 |
Wow, lots of reading material there. I'll go through it when I'm feeling more adventurous again. But essentially, there's no fix then. Are you still going with the |
At least for this module ("grunt-mxmlc"), I think using
|
Yeah, that's what I was afraid of as well. But I mainly don't like the idea of the prerelease suffix for something that isn't a prerelease, so I still prefer the hack on semver I proposed. I know it looks terrible and it doesn't make that much sense semantically, but it would at least solve that. And without having to cave in and use the asterisk. |
FYI, I created a new issue against the SemVer spec that I think is really the only legitimate fix we might have a chance of arriving at in SemVer 3.0.0: semver/semver#242 |
I just installed grunt-mxmlc into a blank npm module using
npm i --save grunt-mxmlc
. For some reason, it insisted on installingflex-sdk@3.5.0
rather than the latest version. Moreover, when I tried to make it install version 4.6.0-0, I got this:If I'm interpreting that error correctly, npm seems to think 4.6.0-0 is lower than 3.0.0-0.
I'm convinced this behavior changed recently. I have a bunch of projects that use grunt-mxmlc and none of them contain an old Flex SDK. Did something change in the way npm and/or semver handles
>=
?This is on Windows with node v0.10.31 (on nodist) with npm v2.1.2.
The text was updated successfully, but these errors were encountered: