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

Remove npm version check #315

Merged
merged 1 commit into from
Jan 3, 2019

Conversation

sonicdoe
Copy link
Contributor

@sonicdoe sonicdoe commented Jan 2, 2019

The current Node.js version check (which is used to determine whether to skip the npm version check) is actually the wrong way around:

skip: () => version.isVersionLower('6.0.0', process.version),

For example, version.isVersionLower('6.0.0', 'v11.6.0') returns false, therefore not skipping the following npm version check:

if (!version.satisfies(versions.npm, '>=2.15.8 <3.0.0 || >=3.10.1')) {

Since most installations nowadays include a newer npm version, the error was probably rarely thrown (even though the task ran on newer Node.js versions). However, Node.js v11.6.0 includes npm v6.5.0-next.0, a pre-release version. Pre-release versions do not satisfy by default which means that the above check fails and the error is thrown.

Instead of fixing the actual error, I’ve decided to remove the whole npm version check since np requires Node.js v8 by now (and won’t actually run on Node.js v6).

Fixes #309.

np requires Node.js 8 to run so it is not necessary to check the npm version on Node.js 6.
@sindresorhus sindresorhus merged commit 08a8066 into sindresorhus:master Jan 3, 2019
@sonicdoe sonicdoe deleted the check-npm-version branch January 3, 2019 08:51
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

Successfully merging this pull request may close these issues.

Error warning about issues with Node 6 is shown when using Node 11.6
2 participants