Skip to content
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

⚠️ [RRFC] Breaking changes for npm@8 #445

Closed
nlf opened this issue Sep 1, 2021 · 14 comments
Closed

⚠️ [RRFC] Breaking changes for npm@8 #445

nlf opened this issue Sep 1, 2021 · 14 comments

Comments

@nlf
Copy link
Contributor

nlf commented Sep 1, 2021

Motivation ("The Why")

  • Consolidate comms & desired feature-set for next version of the npm CLI (ie. v8)
  • We are approaching the node@16 "Active LTS" Release milestone & want to make some decisions quickly
  • In this next release our team has expressed an interest to...
    • minimize breaking changes
    • increase supportability while decreasing our maintenance burden
    • align more closely with node's release cadence & versioning (ex. keeping odd numbers as more experimental)

How

  • npm@8 drops support for node<12
  • npm@8 will refuse to install in node versions it doesn't work with

Dropping node<12

Today, we have rather a lot of workarounds for node 10 to keep things working. Part of this step will involve actively seeking those workarounds and removing them.

This will reduce the overall volume of code we maintain, and allow for simplifying things in other places.

Refuse to install in old node versions

A lesson we learned with the release of npm@7 is that we need to be more careful about how we interact with versions of node we don't work on. Quite a few folks had problems caused by npm@6 allowing npm@7 to be installed in node@8, this is something we intend to resolve.

Actively refusing to install an npm version that does not work with the user's current version of node will help reduce confusion and frustration for our users, as well as reducing support requests. With clear messaging, we can also encourage users to keep their node versions up to date.

Questions and concerns

Please share them here!

@ljharb
Copy link
Contributor

ljharb commented Sep 1, 2021

What about the "stricter peer deps" change becoming default?

@wraithgar
Copy link
Member

Can we drop the programmatic API so that we can iterate on it in node8 before we (potentially) allow it again?

@wraithgar
Copy link
Member

the "flat out refuse to install a version of itself that is incompatible" should land in npm@7

@isaacs
Copy link
Contributor

isaacs commented Sep 2, 2021

Dropping the programmatic API should be non-breaking for Node.js, because it doesn't affect npm's use as a CLI. Anyone listing npm as a dependency and using require('npm') will be fine, since they'll still get whatever version they're depending on.

@darcyclarke darcyclarke pinned this issue Sep 8, 2021
@darcyclarke darcyclarke changed the title [RRFC] Breaking changes for npm@8 ⚠️ [RRFC] Breaking changes for npm@8 Sep 15, 2021
@fbartho
Copy link

fbartho commented Sep 16, 2021

Why not leapfrog straight to <14? A more aggressive deprecation process might yield even more benefits for NPM’s maintenance.

To be frank, it wouldn’t upset me if there was an NPM major version per major Node version.

@ljharb
Copy link
Contributor

ljharb commented Sep 16, 2021

node 12 is still in LTS.

@bnb
Copy link

bnb commented Sep 16, 2021

Yeah, Node.js 12 is still actively supported. It would be a mistake to not support something that is still supported by the Node.js project.

@voxpelli
Copy link

As most of you probably already know, when dropping support for Node.js 12 many maintainers in the ecosystem has also decided to start adopting ESM, like eg. @sindresorhus and @wooorm: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Would that be a wish from the npm team as well? For both npm itself and the modules, like @npmcli/arborist, npm-audit-report etc, that make up npm?

And if so, maybe supported versions should be limited to ^12.20.0 || ^14.13.1 || >=16.0.0 as suggested by the post by @sindresorhus?

Or should a move to ESM-style modules wait until at least npm@9? If so, it will be hard to update to any dependencies that are strictly ESM until then.

@mrmckeb
Copy link

mrmckeb commented Sep 17, 2021

I think this is a good move. Node 12 is in "maintenance" LTS, not "active" and users wouldn't be forced to move to npm@8.

Something else I'd also like to see in npm@8 is the return of engine-checks, at least for npm and Node versions.

@isaacs
Copy link
Contributor

isaacs commented Sep 17, 2021

@mrmckeb Actually the strict engines check just for npm itself just landed in v7. That way, we can prevent npm 7 users from upgrading to npm 8 if they're using node 10.

@ljharb
Copy link
Contributor

ljharb commented Sep 17, 2021

Dependencies that are strictly ESM can be easily replaced with ones that prefer maximum compatibility, so i don't think that's much of a blocker.

@wraithgar
Copy link
Member

We will also be updating node-gyp to version 8 in the initial npm@8.0.0 release. That version of node-gyp already supports node >10.12.0, so there won't be any incompatibilities between it and the versions we will be supporting in npm@8.

@vprasanth
Copy link

vprasanth commented Oct 17, 2021

image

Is the version selector supposed to be updated? Or at least have a note re: v8.x?

@wraithgar
Copy link
Member

We're working on updating the docs site. Version 8 is identical to version 7 except for an engines update so those docs should be accurate for v8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants