1LOGGING(7) LOGGING(7)
2
3
4
6 Logging - Why, What & How we Log
7
8 Description
9 The npm CLI has various mechanisms for showing different levels of in‐
10 formation back to end-users for certain commands, configurations & en‐
11 vironments.
12
13 Setting Log Levels
14 loglevel
15 loglevel is a global argument/config that can be set to determine the
16 type of information to be displayed.
17
18 The default value of loglevel is "notice" but there are several lev‐
19 els/types of logs available, including:
20
21 • "silent"
22
23 • "error"
24
25 • "warn"
26
27 • "notice"
28
29 • "http"
30
31 • "timing"
32
33 • "info"
34
35 • "verbose"
36
37 • "silly"
38
39
40 All logs pertaining to a level proceeding the current setting will be
41 shown.
42
43 All logs are written to a debug log, with the path to that file printed
44 if the execution of a command fails.
45
46 Aliases
47 The log levels listed above have various corresponding aliases, includ‐
48 ing:
49
50 • -d: --loglevel info
51
52 • --dd: --loglevel verbose
53
54 • --verbose: --loglevel verbose
55
56 • --ddd: --loglevel silly
57
58 • -q: --loglevel warn
59
60 • --quiet: --loglevel warn
61
62 • -s: --loglevel silent
63
64 • --silent: --loglevel silent
65
66
67 foreground-scripts
68 The npm CLI began hiding the output of lifecycle scripts for npm in‐
69 stall as of v7. Notably, this means you will not see logs/output from
70 packages that may be using "install scripts" to display information
71 back to you or from your own project's scripts defined in package.json.
72 If you'd like to change this behavior & log this output you can set
73 foreground-scripts to true.
74
75 Registry Response Headers
76 npm-notice
77 The npm CLI reads from & logs any npm-notice headers that are returned
78 from the configured registry. This mechanism can be used by third-party
79 registries to provide useful information when network-dependent re‐
80 quests occur.
81
82 This header is not cached, and will not be logged if the request is
83 served from the cache.
84
85 See also
86 • npm help config
87
88
89
90
91 January 2022 LOGGING(7)