npm "unsupported Node version" warning gives nonsensical advice


(P Roebuck) #1

What I Did

Use of an old version of npm with current version of node.
Expected warning (which occurs), but advice given is nonsensical.

What Happened

$ npm test
npm WARN npm npm does not support Node.js v11.1.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9, 10.
npm WARN npm You can find the latest version at https://nodejs.org/

Reproduction Steps

Install current version of Node (11.x)
$ npm install -g npm@^5
Issue npm command

Details

The warning message given appears to only consider use of new npm with old node.
Telling user to upgrade node (lines 2 & 5) makes no sense; it should say to upgrade npm instead.

Platform Info

Occurs on both Unix and Windows

$ node --version
v11.1.0
$ npm --version
5.10.0

(Lars Willighagen) #2

You’re running an older version of npm, which doesn’t support node 11 yet (or at least doesn’t know if it does). Explicit support has been added in v6.0.1. As for the wording of the warning message, there’s a PR for that but the author closed it for some reason.


(P Roebuck) #3

I know I’m running an older version of npm. It’s the wording of the warning that’s the problem. Looked at the PR, and while much improved, should still be recommending an npm update rather than a Node downgrade.