Skip to content

[BUG] npm prompts v7 to be upgraded to and installs with Node 8 #2625

@fluxsauce

Description

@fluxsauce

Current Behavior:

When running Node 8 LTS, npm advertises incompatible version of npm:

   ╭───────────────────────────────────────────────────────────────╮
   │                                                               │
   │      New major version of npm available! 6.13.4 → 7.5.2       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v7.5.2   │
   │               Run npm install -g npm to update!               │
   │                                                               │
   ╰───────────────────────────────────────────────────────────────╯

npm i -g npm upgrades to an incompatible version of npm if you're running an unsupported version of Node.

Expected Behavior:

  • npm doesn't recommend v7 if you're not using a compatible version of node
  • Latest 6.x version is installed (last supported by Node 8).

Steps To Reproduce:

  1. Node 8 LTS installed
  2. npm v6 installed
  3. npm i npm -g
jonpeck@tec-jpeck-linux:~$ node --version
v8.17.0
jonpeck@tec-jpeck-linux:~$ npm i -g npm
/home/jonpeck/n/bin/npm -> /home/jonpeck/n/lib/node_modules/npm/bin/npm-cli.js
/home/jonpeck/n/bin/npx -> /home/jonpeck/n/lib/node_modules/npm/bin/npx-cli.js
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.17.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]

+ [email protected]
added 59 packages from 30 contributors, removed 235 packages and updated 192 packages in 2.82s
jonpeck@tec-jpeck-linux:~$ npm --version
TypeError: Cannot destructure property `stat` of 'undefined' or 'null'.
... (Node compatibility error continues)

Environment:

  • Ubuntu 20.04.2 LTS
  • Node v8.17.0
  • npm 6.14.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 6.xwork is associated with a specific npm 6 releaseRelease 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