-
Notifications
You must be signed in to change notification settings - Fork 44
type: module breaks users on various version of npm #348
Comments
the linked issue's trace isnt entitely clear to me. does npm already use the type field for something? |
Thanks for raising this! The Is there anybody from the npm team that would be the go-to to ping in this context? It looks like the most recent CLI commits are by @isaacs himself but I'm not sure if he'd have context on the affected versions of the CLI. |
npm mutates package.json in installed packages by adding additional metadata (like requiredBy etc); perhaps some versions added “type” when not present and then attempted to read it back later in the install? |
From skimming the code, my guess:
|
So yeah, without fixing |
Is it mandatory for Node to retain compatibility with every version of npm
there ever was? Is there a version range we can reduce it down to?
…On Wed, 10 Jul 2019, 17:47 Jan Olaf Krems, ***@***.***> wrote:
So yeah, without fixing npm (this is present on latest master) and
waiting for *all* users to cycle out the affected versions, type is a
non-starter.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#348?email_source=notifications&email_token=ABU6F5OQGNDMRCIACGTN25LP6YABNA5CNFSM4H7PSUO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZT4TIQ#issuecomment-510118306>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABU6F5IDVIBXTCJCGT5L3GTP6YABNANCNFSM4H7PSUOQ>
.
|
This is odd as I've had |
Another option is to move |
It doesn’t matter if it’s mandatory or not; node supporting a convention that forces packages to break compat with older npm users seems catastrophic. It’s likely that lodash is used by people on older nodes/npms more than systemJS is. It would be good to better understand the conditions here, but i think the top-level name “type” is immediately not an option based on this. |
I may have jumped to a conclusion from seeing suspicious code in latest master. Maybe that code is no longer affected because there's protection somewhere else.
The |
For more context from the Update: Feel free to pop-in to the |
I can reproduce the issue:
Note that that’s with Node 6.7.0, the version of Node reported in the original issue, and the version of npm that shipped with that version of Node (3.10.3, printed above). Correct me if I’m wrong but I think Node 6 has already been retired, and currently the oldest supported version of Node is 8.0.0. The problem is not present in Node 8.0.0 and the version of npm that shipped with it:
So basically, the version of npm (5.0.0) that shipped with the oldest still-supported version of Node (8.0.0) does not have this issue. We could simply tell users that sorry, but the time has come for them to upgrade at least their version of npm; or to set up a mirror of the npm registry and use it to control the versions of packages that they allow their build pipeline to install; or to commit their I also tested with the newest version of Node 6 (6.17.1 / npm 3.10.10, via |
That sounds pretty promising! Thanks for digging into it, @GeoffreyBooth. But I think one important question is - would maintainers of a popular package add it and keep it even when stray node 6 users (with default npm) complain? Or maybe: When would it be realistic that they would keep it? @jdalton Is this something you'd still move forward with, e.g. in |
I'm personally fine with this breakage. It is in an unsupported version of
node and there is a quick way to fix , update npm
…On Thu, Jul 11, 2019, 12:02 PM Jan Olaf Krems ***@***.***> wrote:
That sounds pretty promising! Thanks for digging into it, @GeoffreyBooth
<https://github.com/GeoffreyBooth>. But I think one important question is
- would maintainers of a popular package add it and keep it even when stray
node 6 users (with default npm) complain? Or maybe: When would it be
realistic that they would keep it?
@jdalton <https://github.com/jdalton> Is this something you'd still move
forward with, e.g. in ***@***.***? Or is it too early to tell for you?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#348?email_source=notifications&email_token=AADZYV2VBU2QNNUPP2DFABLP65KSPA5CNFSM4H7PSUO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZXFTIY#issuecomment-510548387>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADZYV2X3TTITINQITRT2MDP65KSPANCNFSM4H7PSUOQ>
.
|
I think renaming the field is a much simpler solution. Updating npm isn’t always easy or possible, and effectively breaking those versions of npm for everyone as the ecosystem adopts this field seems too steep a price just for the word “type”. |
There’s another solution that could avoid a semver major bump, if your reason for wanting And once |
Just a heads up I bumped
lodash-es
to usetype
ofmodule
and got reports of breakage due to variousnpm
versions. See lodash/lodash#4359.The text was updated successfully, but these errors were encountered: