Skip to content

Commit 21719d6

Browse files
committed
error-message: Stop gaslighting our users with "this is probably your fault"
1 parent 87281ee commit 21719d6

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

lib/utils/error-message.js

+5-24
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ function errorMessage (er) {
4646
[
4747
'',
4848
'Failed using git.',
49-
'This is most likely not a problem with npm itself.',
5049
'Please check if you have git installed and in your PATH.'
5150
].join('\n')
5251
])
@@ -178,8 +177,7 @@ function errorMessage (er) {
178177
detail.push([
179178
'network',
180179
[
181-
'This is most likely not a problem with npm itself',
182-
'and is related to network connectivity.',
180+
'This is a problem related to network connectivity.',
183181
'In most cases you are behind a proxy or have bad network settings.',
184182
'\nIf you are behind a proxy, please make sure that the',
185183
"'proxy' config is set properly. See: 'npm help config'"
@@ -192,7 +190,6 @@ function errorMessage (er) {
192190
detail.push([
193191
'package.json',
194192
[
195-
'This is most likely not a problem with npm itself.',
196193
"npm can't find a package.json file in your current directory."
197194
].join('\n')
198195
])
@@ -201,7 +198,6 @@ function errorMessage (er) {
201198
case 'ETARGET':
202199
short.push(['notarget', er.message])
203200
msg = [
204-
'This is most likely not a problem with npm itself.',
205201
'In most cases you or one of your dependencies are requesting',
206202
"a package version that doesn't exist."
207203
]
@@ -235,8 +231,8 @@ function errorMessage (er) {
235231
detail.push([
236232
'nospc',
237233
[
238-
'This is most likely not a problem with npm itself',
239-
'and is related to insufficient space on your system.'
234+
'There appears to be insufficient space on your system to finish.',
235+
'Clear up some disk space and try again.'
240236
].join('\n')
241237
])
242238
break
@@ -246,9 +242,7 @@ function errorMessage (er) {
246242
detail.push([
247243
'rofs',
248244
[
249-
'This is most likely not a problem with npm itself',
250-
'and is related to the file system being read-only.',
251-
'\nOften virtualized file systems, or other file systems',
245+
'Often virtualized file systems, or other file systems',
252246
"that don't support symlinks, give this error."
253247
].join('\n')
254248
])
@@ -259,8 +253,7 @@ function errorMessage (er) {
259253
detail.push([
260254
'enoent',
261255
[
262-
'This is most likely not a problem with npm itself',
263-
'and is related to npm not being able to find a file.',
256+
'This is related to npm not being able to find a file.',
264257
er.file ? "\nCheck if the file '" + er.file + "' is present." : ''
265258
].join('\n')
266259
])
@@ -280,18 +273,6 @@ function errorMessage (er) {
280273
])
281274
break
282275

283-
case 'EISDIR':
284-
short.push(['eisdir', er.message])
285-
detail.push([
286-
'eisdir',
287-
[
288-
'This is most likely not a problem with npm itself',
289-
'and is related to npm not being able to find a package.json in',
290-
'a package you are trying to install.'
291-
].join('\n')
292-
])
293-
break
294-
295276
default:
296277
short.push(['', er.message || er])
297278
break

0 commit comments

Comments
 (0)