Skip to content

Commit cbc6fa9

Browse files
piotrdpd-be
andauthored
fix: order of version information in error message (#8731)
Reordered one of the lines ("Actual:") of output of `EBADENGINE` error in order to align it with the previous like ("Required"). The output is now easier to comprehend. Before the change (note 2 last lines): ```sh $ npm i npm error code EBADENGINE npm error engine Unsupported engine npm error engine Not compatible with your version of node/npm: undefined npm error notsup Not compatible with your version of node/npm: undefined npm error notsup Required: {"node":">=22.21.0 <23.0.0","npm":">=10.0.0"} npm error notsup Actual: {"npm":"10.8.2","node":"v20.19.5"} ``` After the change: ```sh […] npm error notsup Required: {"node":">=22.21.0 <23.0.0","npm":">=10.0.0"} npm error notsup Actual: {"node":"v20.19.5","npm":"10.8.2"} ``` Co-authored-by: Piotr D <[email protected]>
1 parent 11dbd7e commit cbc6fa9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/utils/error-message.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const errorMessage = (er, npm) => {
301301
'Not compatible with your version of node/npm: ' + er.pkgid,
302302
'Required: ' + JSON.stringify(er.required),
303303
'Actual: ' +
304-
JSON.stringify({ npm: npm.version, node: process.version }),
304+
JSON.stringify({ node: process.version, npm: npm.version }),
305305
].join('\n')])
306306
break
307307

tap-snapshots/test/lib/utils/error-message.js.test.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Object {
222222
String(
223223
Not compatible with your version of node/npm: some@package
224224
Required: undefined
225-
Actual: {"npm":"123.456.789-npm","node":"123.456.789-node"}
225+
Actual: {"node":"123.456.789-node","npm":"123.456.789-npm"}
226226
),
227227
],
228228
],
@@ -1202,7 +1202,7 @@ Object {
12021202
String(
12031203
Not compatible with your version of node/npm: some@package
12041204
Required: undefined
1205-
Actual: {"npm":"123.456.789-npm","node":"123.456.789-node"}
1205+
Actual: {"node":"123.456.789-node","npm":"123.456.789-npm"}
12061206
),
12071207
],
12081208
],

0 commit comments

Comments
 (0)