From 939a188bc3ab9c2bfa49ccb4837fe4ad844131ed Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 20 Jun 2023 10:00:31 -0700 Subject: [PATCH] fix: ignore node prereleases in npm engines check (#6574) They don't currently have any so that code would never have mattered cf https://nodejs.org/download/release/ --- lib/es6/validate-engines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/es6/validate-engines.js b/lib/es6/validate-engines.js index 0eaa549fc3702..cf5315a25dce0 100644 --- a/lib/es6/validate-engines.js +++ b/lib/es6/validate-engines.js @@ -9,7 +9,7 @@ const { engines: { node: engines }, version } = require('../../package.json') const npm = `v${version}` module.exports = (process, getCli) => { - const node = process.version.replace(/-.*$/, '') + const node = process.version /* eslint-disable-next-line max-len */ const unsupportedMessage = `npm ${npm} does not support Node.js ${node}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.`