Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

warn/throw on mismatched engine/platform all the time, not only for newly added modules #134

Closed
isaacs opened this issue Sep 17, 2020 · 6 comments
Assignees
Labels
Enhancement new feature or improvement semver:major backwards-incompatible breaking changes

Comments

@isaacs
Copy link
Contributor

isaacs commented Sep 17, 2020

See npm/rfcs#195

  • Currently we call checkEngine()/checkPlatform() in lib/arborist/reify.js, but only for nodes being added to the tree in reifyNode().
  • Either move that check to loadActual and loadVirtual, so that we can warn when we're initially building the tree, or put it in buildIdealTree since we only care about it when we're going to be modifying stuff? (Ie, should npm ls warn about it? Should npm ls --engines-strict fail entirely and not even show a tree?)
  • Since it's probably too aggressive to fail entirely if a package in the virtual/actual tree has an engine/platform mismatch, we can collect these errors up to the top level, and then have buildIdealTree() decide to throw if there are any engine mismatches and options.enginesStrict is true.
@isaacs
Copy link
Contributor Author

isaacs commented Sep 17, 2020

Also: we should track the node/npm version in the package lock, and only run this check (at least in loadVirtual) if it doesn't match the current node/npm versions.

@bonkydog bonkydog self-assigned this Sep 17, 2020
@markablov
Copy link

@isaacs should i implement that by my own? arborist looks not very familiar to me, but i think i can handle that.

@bonkydog
Copy link
Contributor

Hi, @markablov. Thanks, but I just started working on this yesterday.

@darcyclarke darcyclarke added the semver:major backwards-incompatible breaking changes label Sep 18, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 15 milestone Sep 18, 2020
@darcyclarke darcyclarke added Enhancement new feature or improvement Release 7.x labels Sep 18, 2020
@darcyclarke
Copy link
Contributor

Should land in the next beta release. Work landed in arborist here: #138

@bonkydog bonkydog reopened this Sep 28, 2020
@darcyclarke
Copy link
Contributor

@bonkydog noticed you reopened this, I think you mentioned there was a bug in this work yesterday that you were fixing but I didn't see any mention here. Can we use either a draff/WIP PR or net-new issue to track that fix?

@bonkydog
Copy link
Contributor

Sorry, yeah this is closed. I re-opened it by mistake.

There's an error message fix on CLI here ready for review:

npm/cli#1876

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement new feature or improvement semver:major backwards-incompatible breaking changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants