Skip to content

[BUG] npm should refuse to install a version of npm that has an engines conflict #2612

@wraithgar

Description

@wraithgar

Current Behavior:

I can install a version of npm in an environment where the engines property in the packument does not include the version of node it is being run under.

Expected Behavior:

npm refuses to install a version of npm for which it has a conflict between the current node version and the engines entry in the version of npm you are trying to install.

Environment:

  • npm: 7.5.2

Problem statement

Today we allow users to install npm even though they might be on a version of node that we don't want to or can't support (ex. node@<10).

Features

  • Test adding a preinstall script to npm@7 which warns/errors our of unsupported environment

Exit criteria

  • script should not allow you to end up in a broken state/environment
  • warning should provide context/details on how to fix or upgrade

Metadata

Metadata

Assignees

Labels

Enhancementnew feature or improvementRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions