Debian Codegraph @

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

raw
1 /* IMPORTANT
2 * This snapshot file is auto-generated, but designed for humans.
3 * It should be checked into source control and tracked carefully.
4 * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
5 * Make sure to inspect the output below. Do not ignore changes!
6 */
7 'use strict'
8 exports[`test/lib/utils/error-message.js TAP 404 cleans sensitive info from package id > must match snapshot 1`] = `
9 Object {
10 "detail": Array [
11 Array [
12 "404",
13 "",
14 ],
15 Array [
16 "404",
17 "",
18 "The requested resource 'http://evil:***@npmjs.org/not-found' could not be found or you do not have permission to access it.",
19 ],
20 Array [
21 "404",
22 "This package name is not valid, because",
23 "",
24 ],
25 Array [
26 "404",
27 " 1. name can only contain URL-friendly characters",
28 ],
29 Array [
30 "404",
31 "",
32 ],
33 Array [
34 "404",
35 "Note that you can also install from a",
36 ],
37 Array [
38 "404",
39 "tarball, folder, http url, or git url.",
40 ],
41 ],
42 "summary": Array [
43 Array [
44 "404",
45 "not found",
46 ],
47 ],
48 }
49 `
50
51 exports[`test/lib/utils/error-message.js TAP 404 name with error > must match snapshot 1`] = `
52 Object {
53 "detail": Array [
54 Array [
55 "404",
56 "",
57 ],
58 Array [
59 "404",
60 "",
61 "The requested resource 'node_modules' could not be found or you do not have permission to access it.",
62 ],
63 Array [
64 "404",
65 "This package name is not valid, because",
66 "",
67 ],
68 Array [
69 "404",
70 " 1. node_modules is not a valid package name",
71 ],
72 Array [
73 "404",
74 "",
75 ],
76 Array [
77 "404",
78 "Note that you can also install from a",
79 ],
80 Array [
81 "404",
82 "tarball, folder, http url, or git url.",
83 ],
84 ],
85 "summary": Array [
86 Array [
87 "404",
88 "not found",
89 ],
90 ],
91 }
92 `
93
94 exports[`test/lib/utils/error-message.js TAP 404 name with warning > must match snapshot 1`] = `
95 Object {
96 "detail": Array [
97 Array [
98 "404",
99 "",
100 ],
101 Array [
102 "404",
103 "",
104 "The requested resource 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' could not be found or you do not have permission to access it.",
105 ],
106 Array [
107 "404",
108 "This package name is not valid, because",
109 "",
110 ],
111 Array [
112 "404",
113 " 1. name can no longer contain more than 214 characters",
114 ],
115 Array [
116 "404",
117 "",
118 ],
119 Array [
120 "404",
121 "Note that you can also install from a",
122 ],
123 Array [
124 "404",
125 "tarball, folder, http url, or git url.",
126 ],
127 ],
128 "summary": Array [
129 Array [
130 "404",
131 "not found",
132 ],
133 ],
134 }
135 `
136
137 exports[`test/lib/utils/error-message.js TAP 404 no package id > must match snapshot 1`] = `
138 Object {
139 "detail": Array [],
140 "summary": Array [
141 Array [
142 "404",
143 "not found",
144 ],
145 ],
146 }
147 `
148
149 exports[`test/lib/utils/error-message.js TAP 404 you should publish it > must match snapshot 1`] = `
150 Object {
151 "detail": Array [
152 Array [
153 "404",
154 "",
155 ],
156 Array [
157 "404",
158 "",
159 "The requested resource 'yolo' could not be found or you do not have permission to access it.",
160 ],
161 Array [
162 "404",
163 "",
164 ],
165 Array [
166 "404",
167 "Note that you can also install from a",
168 ],
169 Array [
170 "404",
171 "tarball, folder, http url, or git url.",
172 ],
173 ],
174 "summary": Array [
175 Array [
176 "404",
177 "not found",
178 ],
179 ],
180 }
181 `
182
183 exports[`test/lib/utils/error-message.js TAP args are cleaned > must match snapshot 1`] = `
184 Object {
185 "detail": Array [
186 Array [
187 "signal",
188 "SIGYOLO",
189 ],
190 Array [
191 "command",
192 "some command",
193 "a",
194 "r",
195 "g",
196 "s",
197 "https://evil:***@npmjs.org",
198 ],
199 Array [
200 "",
201 "stdout",
202 ],
203 Array [
204 "",
205 "stderr",
206 ],
207 ],
208 "summary": Array [
209 Array [
210 "",
211 "cmd err",
212 ],
213 ],
214 }
215 `
216
217 exports[`test/lib/utils/error-message.js TAP bad engine without config loaded > must match snapshot 1`] = `
218 Object {
219 "detail": Array [
220 Array [
221 "notsup",
222 String(
223 Not compatible with your version of node/npm: some@package
224 Required: undefined
225 Actual: {"node":"123.456.789-node","npm":"123.456.789-npm"}
226 ),
227 ],
228 ],
229 "summary": Array [
230 Array [
231 "engine",
232 "foo",
233 ],
234 Array [
235 "engine",
236 "Not compatible with your version of node/npm: some@package",
237 ],
238 ],
239 }
240 `
241
242 exports[`test/lib/utils/error-message.js TAP bad platform array os/arch > must match snapshot 1`] = `
243 Object {
244 "detail": Array [
245 Array [
246 "notsup",
247 String(
248 Valid os: !yours,mine
249 Actual os: posix
250 Valid cpu: x867,x5309
251 Actual cpu: x64
252 ),
253 ],
254 ],
255 "summary": Array [
256 Array [
257 "notsup",
258 "Unsupported platform for [email protected]: wanted {/"os/":/"!yours,mine/",/"cpu/":/"x867,x5309/"} (current: {/"os/":/"posix/",/"cpu/":/"x64/"})",
259 ],
260 ],
261 }
262 `
263
264 exports[`test/lib/utils/error-message.js TAP bad platform omits keys with no required value > must match snapshot 1`] = `
265 Object {
266 "detail": Array [
267 Array [
268 "notsup",
269 String(
270 Valid os: !yours,mine
271 Actual os: posix
272 ),
273 ],
274 ],
275 "summary": Array [
276 Array [
277 "notsup",
278 "Unsupported platform for [email protected]: wanted {/"os/":/"!yours,mine/"} (current: {/"os/":/"posix/"})",
279 ],
280 ],
281 }
282 `
283
284 exports[`test/lib/utils/error-message.js TAP bad platform string os/arch > must match snapshot 1`] = `
285 Object {
286 "detail": Array [
287 Array [
288 "notsup",
289 String(
290 Valid os: !yours
291 Actual os: posix
292 Valid cpu: x420
293 Actual cpu: x64
294 ),
295 ],
296 ],
297 "summary": Array [
298 Array [
299 "notsup",
300 "Unsupported platform for [email protected]: wanted {/"os/":/"!yours/",/"cpu/":/"x420/"} (current: {/"os/":/"posix/",/"cpu/":/"x64/"})",
301 ],
302 ],
303 }
304 `
305
306 exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 1`] = `
307 Object {
308 "detail": Array [],
309 "summary": Array [
310 Array [
311 "",
312 "error object",
313 ],
314 ],
315 }
316 `
317
318 exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 2`] = `
319 Object {
320 "detail": Array [],
321 "summary": Array [
322 Array [
323 "",
324 "error string",
325 ],
326 ],
327 }
328 `
329
330 exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 3`] = `
331 Object {
332 "detail": Array [
333 Array [
334 "signal",
335 "SIGYOLO",
336 ],
337 Array [
338 "command",
339 "some command",
340 "a",
341 "r",
342 "g",
343 "s",
344 ],
345 Array [
346 "",
347 "stdout",
348 ],
349 Array [
350 "",
351 "stderr",
352 ],
353 ],
354 "summary": Array [
355 Array [
356 "",
357 "cmd err",
358 ],
359 ],
360 }
361 `
362
363 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = `
364 Object {
365 "detail": Array [
366 Array [
367 "",
368 String(
369
370 The operation was rejected by your operating system.
371 It is likely you do not have the permissions to access this file as the current user
372
373 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
374 ),
375 ],
376 ],
377 "summary": Array [
378 Array [
379 "",
380 Error: whoopsie {
381 "code": "EACCES",
382 "dest": "/not/cache/dir/dest",
383 "path": "/not/cache/dir/path",
384 },
385 ],
386 ],
387 }
388 `
389
390 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = `
391 Array []
392 `
393
394 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = `
395 Object {
396 "detail": Array [
397 Array [
398 "",
399 String(
400
401 The operation was rejected by your operating system.
402 It is likely you do not have the permissions to access this file as the current user
403
404 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
405 ),
406 ],
407 ],
408 "summary": Array [
409 Array [
410 "",
411 Error: whoopsie {
412 "code": "EACCES",
413 "dest": "{CWD}/cache/dest",
414 "path": "/not/cache/dir/path",
415 },
416 ],
417 ],
418 }
419 `
420
421 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = `
422 Array []
423 `
424
425 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = `
426 Object {
427 "detail": Array [
428 Array [
429 "",
430 String(
431
432 The operation was rejected by your operating system.
433 It is likely you do not have the permissions to access this file as the current user
434
435 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
436 ),
437 ],
438 ],
439 "summary": Array [
440 Array [
441 "",
442 Error: whoopsie {
443 "code": "EACCES",
444 "dest": "/not/cache/dir/dest",
445 "path": "{CWD}/cache/path",
446 },
447 ],
448 ],
449 }
450 `
451
452 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = `
453 Array []
454 `
455
456 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = `
457 Object {
458 "detail": Array [
459 Array [
460 "",
461 String(
462
463 The operation was rejected by your operating system.
464 It is likely you do not have the permissions to access this file as the current user
465
466 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
467 ),
468 ],
469 ],
470 "summary": Array [
471 Array [
472 "",
473 Error: whoopsie {
474 "code": "EACCES",
475 "dest": "{CWD}/cache/dest",
476 "path": "{CWD}/cache/path",
477 },
478 ],
479 ],
480 }
481 `
482
483 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = `
484 Array []
485 `
486
487 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = `
488 Object {
489 "detail": Array [
490 Array [
491 "",
492 String(
493
494 The operation was rejected by your operating system.
495 It is likely you do not have the permissions to access this file as the current user
496
497 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
498 ),
499 ],
500 ],
501 "summary": Array [
502 Array [
503 "",
504 Error: whoopsie {
505 "code": "EACCES",
506 "dest": "/not/cache/dir/dest",
507 "path": "/not/cache/dir/path",
508 },
509 ],
510 ],
511 }
512 `
513
514 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = `
515 Array [
516 "title npm",
517 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
518 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
519 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
520 ]
521 `
522
523 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = `
524 Object {
525 "detail": Array [],
526 "summary": Array [
527 Array [
528 "",
529 String(
530
531 Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed.
532
533 To permanently fix this problem, please run:
534 sudo chown -R 867:5309 "{CWD}/cache"
535 ),
536 ],
537 ],
538 }
539 `
540
541 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = `
542 Array [
543 "title npm",
544 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
545 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
546 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
547 "dummy stack trace",
548 ]
549 `
550
551 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = `
552 Object {
553 "detail": Array [],
554 "summary": Array [
555 Array [
556 "",
557 String(
558
559 Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed.
560
561 To permanently fix this problem, please run:
562 sudo chown -R 867:5309 "{CWD}/cache"
563 ),
564 ],
565 ],
566 }
567 `
568
569 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = `
570 Array [
571 "title npm",
572 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
573 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
574 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
575 "dummy stack trace",
576 ]
577 `
578
579 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = `
580 Object {
581 "detail": Array [],
582 "summary": Array [
583 Array [
584 "",
585 String(
586
587 Your cache folder contains root-owned files, due to a bug in previous versions of npm which has since been addressed.
588
589 To permanently fix this problem, please run:
590 sudo chown -R 867:5309 "{CWD}/cache"
591 ),
592 ],
593 ],
594 }
595 `
596
597 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = `
598 Array [
599 "title npm",
600 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
601 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
602 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
603 "dummy stack trace",
604 ]
605 `
606
607 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = `
608 Object {
609 "detail": Array [
610 Array [
611 "",
612 String(
613
614 The operation was rejected by your operating system.
615 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
616
617 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
618 ),
619 ],
620 ],
621 "summary": Array [
622 Array [
623 "",
624 Error: whoopsie {
625 "code": "EACCES",
626 "dest": "/not/cache/dir/dest",
627 "path": "/not/cache/dir/path",
628 },
629 ],
630 ],
631 }
632 `
633
634 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = `
635 Array []
636 `
637
638 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = `
639 Object {
640 "detail": Array [
641 Array [
642 "",
643 String(
644
645 The operation was rejected by your operating system.
646 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
647
648 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
649 ),
650 ],
651 ],
652 "summary": Array [
653 Array [
654 "",
655 Error: whoopsie {
656 "code": "EACCES",
657 "dest": "{CWD}/cache/dest",
658 "path": "/not/cache/dir/path",
659 },
660 ],
661 ],
662 }
663 `
664
665 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = `
666 Array []
667 `
668
669 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = `
670 Object {
671 "detail": Array [
672 Array [
673 "",
674 String(
675
676 The operation was rejected by your operating system.
677 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
678
679 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
680 ),
681 ],
682 ],
683 "summary": Array [
684 Array [
685 "",
686 Error: whoopsie {
687 "code": "EACCES",
688 "dest": "/not/cache/dir/dest",
689 "path": "{CWD}/cache/path",
690 },
691 ],
692 ],
693 }
694 `
695
696 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = `
697 Array []
698 `
699
700 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = `
701 Object {
702 "detail": Array [
703 Array [
704 "",
705 String(
706
707 The operation was rejected by your operating system.
708 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
709
710 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
711 ),
712 ],
713 ],
714 "summary": Array [
715 Array [
716 "",
717 Error: whoopsie {
718 "code": "EACCES",
719 "dest": "{CWD}/cache/dest",
720 "path": "{CWD}/cache/path",
721 },
722 ],
723 ],
724 }
725 `
726
727 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = `
728 Array []
729 `
730
731 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = `
732 Object {
733 "detail": Array [
734 Array [
735 "",
736 String(
737
738 The operation was rejected by your operating system.
739 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
740
741 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
742 ),
743 ],
744 ],
745 "summary": Array [
746 Array [
747 "",
748 Error: whoopsie {
749 "code": "EACCES",
750 "dest": "/not/cache/dir/dest",
751 "path": "/not/cache/dir/path",
752 },
753 ],
754 ],
755 }
756 `
757
758 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = `
759 Array [
760 "title npm",
761 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
762 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
763 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
764 ]
765 `
766
767 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = `
768 Object {
769 "detail": Array [
770 Array [
771 "",
772 String(
773
774 The operation was rejected by your operating system.
775 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
776
777 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
778 ),
779 ],
780 ],
781 "summary": Array [
782 Array [
783 "",
784 Error: whoopsie {
785 "code": "EACCES",
786 "dest": "{CWD}/cache/dest",
787 "path": "/not/cache/dir/path",
788 },
789 ],
790 ],
791 }
792 `
793
794 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = `
795 Array [
796 "title npm",
797 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
798 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
799 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
800 ]
801 `
802
803 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = `
804 Object {
805 "detail": Array [
806 Array [
807 "",
808 String(
809
810 The operation was rejected by your operating system.
811 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
812
813 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
814 ),
815 ],
816 ],
817 "summary": Array [
818 Array [
819 "",
820 Error: whoopsie {
821 "code": "EACCES",
822 "dest": "/not/cache/dir/dest",
823 "path": "{CWD}/cache/path",
824 },
825 ],
826 ],
827 }
828 `
829
830 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = `
831 Array [
832 "title npm",
833 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
834 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
835 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
836 ]
837 `
838
839 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = `
840 Object {
841 "detail": Array [
842 Array [
843 "",
844 String(
845
846 The operation was rejected by your operating system.
847 It's possible that the file was already in use (by a text editor or antivirus), or that you lack permissions to access it.
848
849 If you believe this might be a permissions issue, please double-check the permissions of the file and its containing directories, or try running the command again as root/Administrator.
850 ),
851 ],
852 ],
853 "summary": Array [
854 Array [
855 "",
856 Error: whoopsie {
857 "code": "EACCES",
858 "dest": "{CWD}/cache/dest",
859 "path": "{CWD}/cache/path",
860 },
861 ],
862 ],
863 }
864 `
865
866 exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = `
867 Array [
868 "title npm",
869 "argv /"--fetch-retries/" /"0/" /"--cache/" /"{CWD}/cache/" /"--loglevel/" /"silly/" /"--color/" /"false/"",
870 "logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-",
871 "logfile {CWD}/cache/_logs/{DATE}-debug-0.log",
872 ]
873 `
874
875 exports[`test/lib/utils/error-message.js TAP enoent without a file > must match snapshot 1`] = `
876 Object {
877 "detail": Array [
878 Array [
879 "enoent",
880 "This is related to npm not being able to find a file./n",
881 ],
882 ],
883 "summary": Array [
884 Array [
885 "enoent",
886 "foo",
887 ],
888 ],
889 }
890 `
891
892 exports[`test/lib/utils/error-message.js TAP enolock without a command > must match snapshot 1`] = `
893 Object {
894 "detail": Array [
895 Array [
896 "",
897 "Try creating one first with: npm i --package-lock-only",
898 ],
899 Array [
900 "",
901 "Original error: foo",
902 ],
903 ],
904 "summary": Array [
905 Array [
906 "",
907 "This command requires an existing lockfile.",
908 ],
909 ],
910 }
911 `
912
913 exports[`test/lib/utils/error-message.js TAP eotp/e401 401, no auth headers > must match snapshot 1`] = `
914 Object {
915 "detail": Array [],
916 "summary": Array [
917 Array [
918 "",
919 "nope",
920 ],
921 ],
922 }
923 `
924
925 exports[`test/lib/utils/error-message.js TAP eotp/e401 401, no message > must match snapshot 1`] = `
926 Object {
927 "detail": Array [],
928 "summary": Array [
929 Array [
930 "",
931 Object {
932 "code": "E401",
933 },
934 ],
935 ],
936 }
937 `
938
939 exports[`test/lib/utils/error-message.js TAP eotp/e401 one-time pass challenge code > must match snapshot 1`] = `
940 Object {
941 "detail": Array [
942 Array [
943 "",
944 String(
945 You can provide a one-time password by passing --otp=<code> to the command you ran.
946 If you already provided a one-time password then it is likely that you either typoed it, or it timed out. Please try again.
947 ),
948 ],
949 ],
950 "summary": Array [
951 Array [
952 "",
953 "This operation requires a one-time password from your authenticator.",
954 ],
955 ],
956 }
957 `
958
959 exports[`test/lib/utils/error-message.js TAP eotp/e401 one-time pass challenge message > must match snapshot 1`] = `
960 Object {
961 "detail": Array [
962 Array [
963 "",
964 String(
965 You can provide a one-time password by passing --otp=<code> to the command you ran.
966 If you already provided a one-time password then it is likely that you either typoed it, or it timed out. Please try again.
967 ),
968 ],
969 ],
970 "summary": Array [
971 Array [
972 "",
973 "This operation requires a one-time password from your authenticator.",
974 ],
975 ],
976 }
977 `
978
979 exports[`test/lib/utils/error-message.js TAP eotp/e401 one-time pass webauth challenge > must match snapshot 1`] = `
980 Object {
981 "detail": Array [
982 Array [
983 "",
984 "Open this URL in your browser to authenticate:",
985 ],
986 Array [
987 "",
988 " https://registry.npmjs.org/-/auth/login/abc123",
989 ],
990 Array [
991 "",
992 "",
993 ],
994 Array [
995 "",
996 "After authenticating, your token can be retrieved from:",
997 ],
998 Array [
999 "",
1000 " https://registry.npmjs.org/-/auth/done/abc123",
1001 ],
1002 ],
1003 "json": Object {
1004 "authUrl": "https://registry.npmjs.org/-/auth/login/abc123",
1005 "doneUrl": "https://registry.npmjs.org/-/auth/done/abc123",
1006 },
1007 "summary": Array [
1008 Array [
1009 "",
1010 "This operation requires a one-time password.",
1011 ],
1012 ],
1013 }
1014 `
1015
1016 exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges Basic realm=by, charset="UTF-8", challenge="your friends" > must match snapshot 1`] = `
1017 Object {
1018 "detail": Array [
1019 Array [
1020 "",
1021 String(
1022 If you were trying to login, change your password, create an authentication token or enable two-factor authentication then that means you likely typed your password in incorrectly.
1023 Please try again, or recover your password at:
1024 https://www.npmjs.com/forgot
1025
1026 If you were doing some other operation then your saved credentials are probably out of date.
1027 To correct this please try logging in again with:
1028 npm login
1029 ),
1030 ],
1031 ],
1032 "summary": Array [
1033 Array [
1034 "",
1035 "Incorrect or missing password.",
1036 ],
1037 ],
1038 }
1039 `
1040
1041 exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges Bearer realm=do, charset="UTF-8", challenge="yourself" > must match snapshot 1`] = `
1042 Object {
1043 "detail": Array [
1044 Array [
1045 "",
1046 String(
1047 To correct this please try logging in again with:
1048 npm login
1049 ),
1050 ],
1051 ],
1052 "summary": Array [
1053 Array [
1054 "",
1055 "Unable to authenticate, your authentication token seems to be invalid.",
1056 ],
1057 ],
1058 }
1059 `
1060
1061 exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges PickACardAnyCard realm=friday, charset="UTF-8" > must match snapshot 1`] = `
1062 Object {
1063 "detail": Array [],
1064 "summary": Array [
1065 Array [
1066 "",
1067 "challenge!",
1068 ],
1069 ],
1070 }
1071 `
1072
1073 exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges WashYourHands, charset="UTF-8" > must match snapshot 1`] = `
1074 Object {
1075 "detail": Array [],
1076 "summary": Array [
1077 Array [
1078 "",
1079 "challenge!",
1080 ],
1081 ],
1082 }
1083 `
1084
1085 exports[`test/lib/utils/error-message.js TAP explain ERESOLVE errors > must match snapshot 1`] = `
1086 Object {
1087 "detail": Array [
1088 Array [
1089 "",
1090 "",
1091 ],
1092 Array [
1093 "",
1094 "explanation",
1095 ],
1096 ],
1097 "files": Array [
1098 Array [
1099 "eresolve-report.txt",
1100 "report",
1101 ],
1102 ],
1103 "summary": Array [
1104 Array [
1105 "ERESOLVE",
1106 "could not resolve",
1107 ],
1108 ],
1109 }
1110 `
1111
1112 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 1`] = `
1113 Object {
1114 "detail": Array [],
1115 "summary": Array [
1116 Array [
1117 "audit",
1118 "foo",
1119 ],
1120 ],
1121 }
1122 `
1123
1124 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 10`] = `
1125 Object {
1126 "detail": Array [
1127 Array [
1128 "network",
1129 String(
1130 This is a problem related to network connectivity.
1131 In most cases you are behind a proxy or have bad network settings.
1132
1133 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1134 ),
1135 ],
1136 ],
1137 "summary": Array [
1138 Array [
1139 "network",
1140 "foo",
1141 ],
1142 ],
1143 }
1144 `
1145
1146 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 11`] = `
1147 Object {
1148 "detail": Array [
1149 Array [
1150 "network",
1151 String(
1152 This is a problem related to network connectivity.
1153 In most cases you are behind a proxy or have bad network settings.
1154
1155 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1156 ),
1157 ],
1158 ],
1159 "summary": Array [
1160 Array [
1161 "network",
1162 "foo",
1163 ],
1164 ],
1165 }
1166 `
1167
1168 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 12`] = `
1169 Object {
1170 "detail": Array [
1171 Array [
1172 "network",
1173 String(
1174 This is a problem related to network connectivity.
1175 In most cases you are behind a proxy or have bad network settings.
1176
1177 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1178 ),
1179 ],
1180 ],
1181 "summary": Array [
1182 Array [
1183 "network",
1184 "foo",
1185 ],
1186 ],
1187 }
1188 `
1189
1190 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 13`] = `
1191 Object {
1192 "detail": Array [
1193 Array [
1194 "notsup",
1195 String(
1196 Not compatible with your version of node/npm: some@package
1197 Required: undefined
1198 Actual: {"node":"123.456.789-node","npm":"123.456.789-npm"}
1199 ),
1200 ],
1201 ],
1202 "summary": Array [
1203 Array [
1204 "engine",
1205 "foo",
1206 ],
1207 Array [
1208 "engine",
1209 "Not compatible with your version of node/npm: some@package",
1210 ],
1211 ],
1212 }
1213 `
1214
1215 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 14`] = `
1216 Object {
1217 "detail": Array [
1218 Array [
1219 "nospc",
1220 String(
1221 There appears to be insufficient space on your system to finish.
1222 Clear up some disk space and try again.
1223 ),
1224 ],
1225 ],
1226 "summary": Array [
1227 Array [
1228 "nospc",
1229 "foo",
1230 ],
1231 ],
1232 }
1233 `
1234
1235 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 15`] = `
1236 Object {
1237 "detail": Array [
1238 Array [
1239 "rofs",
1240 "Often virtualized file systems, or other file systems that don't support symlinks, give this error.",
1241 ],
1242 ],
1243 "summary": Array [
1244 Array [
1245 "rofs",
1246 "foo",
1247 ],
1248 ],
1249 }
1250 `
1251
1252 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 16`] = `
1253 Object {
1254 "detail": Array [
1255 Array [
1256 "enoent",
1257 String(
1258 This is related to npm not being able to find a file.
1259
1260 Check if the file '/some/file' is present.
1261 ),
1262 ],
1263 ],
1264 "summary": Array [
1265 Array [
1266 "enoent",
1267 "foo",
1268 ],
1269 ],
1270 }
1271 `
1272
1273 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 17`] = `
1274 Object {
1275 "detail": Array [
1276 Array [
1277 "typeerror",
1278 String(
1279 This is an error with npm itself. Please report this error at:
1280 https://github.com/npm/cli/issues
1281 ),
1282 ],
1283 ],
1284 "summary": Array [
1285 Array [
1286 "typeerror",
1287 "dummy stack trace",
1288 ],
1289 ],
1290 }
1291 `
1292
1293 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 18`] = `
1294 Object {
1295 "detail": Array [
1296 Array [
1297 "typeerror",
1298 String(
1299 This is an error with npm itself. Please report this error at:
1300 https://github.com/npm/cli/issues
1301 ),
1302 ],
1303 ],
1304 "summary": Array [
1305 Array [
1306 "typeerror",
1307 "dummy stack trace",
1308 ],
1309 ],
1310 }
1311 `
1312
1313 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 19`] = `
1314 Object {
1315 "detail": Array [
1316 Array [
1317 "typeerror",
1318 String(
1319 This is an error with npm itself. Please report this error at:
1320 https://github.com/npm/cli/issues
1321 ),
1322 ],
1323 ],
1324 "summary": Array [
1325 Array [
1326 "typeerror",
1327 "dummy stack trace",
1328 ],
1329 ],
1330 }
1331 `
1332
1333 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 2`] = `
1334 Object {
1335 "detail": Array [
1336 Array [
1337 "audit",
1338 "Try creating one first with: npm i --package-lock-only",
1339 ],
1340 Array [
1341 "audit",
1342 "Original error: foo",
1343 ],
1344 ],
1345 "summary": Array [
1346 Array [
1347 "audit",
1348 "This command requires an existing lockfile.",
1349 ],
1350 ],
1351 }
1352 `
1353
1354 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 20`] = `
1355 Object {
1356 "detail": Array [
1357 Array [
1358 "typeerror",
1359 String(
1360 This is an error with npm itself. Please report this error at:
1361 https://github.com/npm/cli/issues
1362 ),
1363 ],
1364 ],
1365 "summary": Array [
1366 Array [
1367 "typeerror",
1368 "dummy stack trace",
1369 ],
1370 ],
1371 }
1372 `
1373
1374 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 21`] = `
1375 Object {
1376 "detail": Array [
1377 Array [
1378 "notarget",
1379 "In most cases you or one of your dependencies are requesting a package version that doesn't exist.",
1380 ],
1381 ],
1382 "summary": Array [
1383 Array [
1384 "notarget",
1385 "foo",
1386 ],
1387 ],
1388 }
1389 `
1390
1391 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 22`] = `
1392 Object {
1393 "detail": Array [
1394 Array [
1395 "403",
1396 "In most cases, you or one of your dependencies are requesting a package version that is forbidden by your security policy, or on a server you do not have access to.",
1397 ],
1398 ],
1399 "summary": Array [
1400 Array [
1401 "403",
1402 "foo",
1403 ],
1404 ],
1405 }
1406 `
1407
1408 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 23`] = `
1409 Object {
1410 "detail": Array [
1411 Array [
1412 "network",
1413 String(
1414 This is a problem related to network connectivity.
1415 In most cases you are behind a proxy or have bad network settings.
1416
1417 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1418 ),
1419 ],
1420 ],
1421 "summary": Array [
1422 Array [
1423 "network",
1424 "foo",
1425 ],
1426 ],
1427 }
1428 `
1429
1430 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 3`] = `
1431 Object {
1432 "detail": Array [
1433 Array [
1434 "",
1435 String(
1436
1437 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1438 ),
1439 ],
1440 ],
1441 "summary": Array [
1442 Array [
1443 "",
1444 Error: foo {
1445 "code": "ECONNREFUSED",
1446 "file": "/some/file",
1447 "path": "/some/path",
1448 "pkgid": "some@package",
1449 },
1450 ],
1451 ],
1452 }
1453 `
1454
1455 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 4`] = `
1456 Object {
1457 "detail": Array [
1458 Array [
1459 "",
1460 String(
1461
1462 Failed using git.
1463 Please check if you have git installed and in your PATH.
1464 ),
1465 ],
1466 ],
1467 "summary": Array [
1468 Array [
1469 "",
1470 "foo",
1471 ],
1472 ],
1473 }
1474 `
1475
1476 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 5`] = `
1477 Object {
1478 "detail": Array [
1479 Array [
1480 "publish fail",
1481 "Update the 'version' field in package.json and try again.",
1482 ],
1483 Array [
1484 "publish fail",
1485 "",
1486 ],
1487 Array [
1488 "publish fail",
1489 "To automatically increment version numbers, see:",
1490 ],
1491 Array [
1492 "publish fail",
1493 " npm help version",
1494 ],
1495 ],
1496 "summary": Array [
1497 Array [
1498 "publish fail",
1499 "Cannot publish over existing version.",
1500 ],
1501 ],
1502 }
1503 `
1504
1505 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 6`] = `
1506 Object {
1507 "detail": Array [
1508 Array [
1509 "git",
1510 "Refusing to remove it. Update manually, or move it out of the way first.",
1511 ],
1512 ],
1513 "summary": Array [
1514 Array [
1515 "git",
1516 "foo",
1517 ],
1518 Array [
1519 "git",
1520 " /some/path",
1521 ],
1522 ],
1523 }
1524 `
1525
1526 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 7`] = `
1527 Object {
1528 "detail": Array [
1529 Array [
1530 "",
1531 "Remove the existing file and try again, or run npm",
1532 ],
1533 Array [
1534 "",
1535 "with --force to overwrite files recklessly.",
1536 ],
1537 ],
1538 "summary": Array [
1539 Array [
1540 "",
1541 "foo",
1542 ],
1543 Array [
1544 "",
1545 "File exists: /some/path",
1546 ],
1547 ],
1548 }
1549 `
1550
1551 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 8`] = `
1552 Object {
1553 "detail": Array [
1554 Array [
1555 "need auth",
1556 "You need to authorize this machine using \`npm adduser\`",
1557 ],
1558 ],
1559 "summary": Array [
1560 Array [
1561 "need auth",
1562 "foo",
1563 ],
1564 ],
1565 }
1566 `
1567
1568 exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 9`] = `
1569 Object {
1570 "detail": Array [
1571 Array [
1572 "network",
1573 String(
1574 This is a problem related to network connectivity.
1575 In most cases you are behind a proxy or have bad network settings.
1576
1577 If you are behind a proxy, please make sure that the 'proxy' config is set properly. See: 'npm help config'
1578 ),
1579 ],
1580 ],
1581 "summary": Array [
1582 Array [
1583 "network",
1584 "foo",
1585 ],
1586 ],
1587 }
1588 `
1589
1590 exports[`test/lib/utils/error-message.js TAP replace message/stack sensitive info > must match snapshot 1`] = `
1591 Object {
1592 "detail": Array [],
1593 "summary": Array [
1594 Array [
1595 "audit",
1596 "Error at registry: https://user:***@registry.npmjs.org/",
1597 ],
1598 ],
1599 }
1600 `
1601
1602 exports[`v TAP json parse json somewhere else > must match snapshot 1`] = `
1603 Object {
1604 "detail": Array [
1605 Array [
1606 "JSON.parse",
1607 String(
1608 Failed to parse JSON data.
1609 Note: package.json must be actual JSON, not just JavaScript.
1610 ),
1611 ],
1612 ],
1613 "summary": Array [
1614 Array [
1615 "JSON.parse",
1616 "not json",
1617 ],
1618 ],
1619 }
1620 `
1621
1622 exports[`v TAP json parse just regular bad json in package.json > must match snapshot 1`] = `
1623 Object {
1624 "detail": Array [
1625 Array [
1626 "JSON.parse",
1627 String(
1628 Failed to parse JSON data.
1629 Note: package.json must be actual JSON, not just JavaScript.
1630 ),
1631 ],
1632 ],
1633 "summary": Array [
1634 Array [
1635 "JSON.parse",
1636 "not json",
1637 ],
1638 ],
1639 }
1640 `
1641
1642 exports[`v TAP json parse merge conflict in package.json > must match snapshot 1`] = `
1643 Object {
1644 "detail": Array [
1645 Array [
1646 "",
1647 String(
1648 Merge conflict detected in your package.json.
1649
1650 Please resolve the package.json conflict and retry.
1651 ),
1652 ],
1653 ],
1654 "summary": Array [],
1655 }
1656 `