| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1014,8 +1014,8 @@ Ideal if all users are on npm version 7 and higher. | |||
| 1014 | 1014 | * Type: "silent", "error", "warn", "notice", "http", "timing", "info", | |
| 1015 | 1015 | "verbose", or "silly" | |
| 1016 | 1016 | ||
| 1017 | - What level of logs to report. On failure, *all* logs are written to | ||
| 1018 | - `npm-debug.log` in the current working directory. | ||
| 1017 | + What level of logs to report. All logs are written to a debug log, with the | ||
| 1018 | + path to that file printed if the execution of a command fails. | ||
| 1019 | 1019 | ||
| 1020 | 1020 | Any logs of a higher level than the setting are shown. The default is | |
| 1021 | 1021 | "notice". | |
@@ -1387,7 +1387,7 @@ Save installed packages to a package.json file as `optionalDependencies`. | |||
| 1387 | 1387 | * Default: false | |
| 1388 | 1388 | * Type: Boolean | |
| 1389 | 1389 | ||
| 1390 | - Save installed packages. to a package.json file as `peerDependencies` | ||
| 1390 | + Save installed packages to a package.json file as `peerDependencies` | ||
| 1391 | 1391 | ||
| 1392 | 1392 | <!-- automatically generated, do not edit manually --> | |
| 1393 | 1393 | <!-- see lib/utils/config/definitions.js --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,60 @@ | |||
| 1 | + --- | ||
| 2 | + title: Logging | ||
| 3 | + section: 7 | ||
| 4 | + description: Why, What & How we Log | ||
| 5 | + --- | ||
| 6 | + | ||
| 7 | + ### Description | ||
| 8 | + | ||
| 9 | + The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments. | ||
| 10 | + | ||
| 11 | + ### Setting Log Levels | ||
| 12 | + | ||
| 13 | + #### `loglevel` | ||
| 14 | + | ||
| 15 | + `loglevel` is a global argument/config that can be set to determine the type of information to be displayed. | ||
| 16 | + | ||
| 17 | + The default value of `loglevel` is `"notice"` but there are several levels/types of logs available, including: | ||
| 18 | + | ||
| 19 | + - `"silent"` | ||
| 20 | + - `"error"` | ||
| 21 | + - `"warn"` | ||
| 22 | + - `"notice"` | ||
| 23 | + - `"http"` | ||
| 24 | + - `"timing"` | ||
| 25 | + - `"info"` | ||
| 26 | + - `"verbose"` | ||
| 27 | + - `"silly"` | ||
| 28 | + | ||
| 29 | + All logs pertaining to a level proceeding the current setting will be shown. | ||
| 30 | + | ||
| 31 | + All logs are written to a debug log, with the path to that file printed if the execution of a command fails. | ||
| 32 | + | ||
| 33 | + ##### Aliases | ||
| 34 | + | ||
| 35 | + The log levels listed above have various corresponding aliases, including: | ||
| 36 | + | ||
| 37 | + - `-d`: `--loglevel info` | ||
| 38 | + - `--dd`: `--loglevel verbose` | ||
| 39 | + - `--verbose`: `--loglevel verbose` | ||
| 40 | + - `--ddd`: `--loglevel silly` | ||
| 41 | + - `-q`: `--loglevel warn` | ||
| 42 | + - `--quiet`: `--loglevel warn` | ||
| 43 | + - `-s`: `--loglevel silent` | ||
| 44 | + - `--silent`: `--loglevel silent` | ||
| 45 | + | ||
| 46 | + #### `foreground-scripts` | ||
| 47 | + | ||
| 48 | + The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`. | ||
| 49 | + | ||
| 50 | + ### Registry Response Headers | ||
| 51 | + | ||
| 52 | + #### `npm-notice` | ||
| 53 | + | ||
| 54 | + The `npm` CLI reads from & logs any `npm-notice` headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur. | ||
| 55 | + | ||
| 56 | + This header is not cached, and will not be logged if the request is served from the cache. | ||
| 57 | + | ||
| 58 | + ### See also | ||
| 59 | + | ||
| 60 | + * [config](/using-npm/config) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -259,7 +259,7 @@ package.json file, then your package scripts would have the | |||
| 259 | 259 | in your code with `process.env.npm_package_name` and | |
| 260 | 260 | `process.env.npm_package_version`, and so on for other fields. | |
| 261 | 261 | ||
| 262 | - See [`package-json.md`](/configuring-npm/package-json) for more on package configs. | ||
| 262 | + See [`package.json`](/configuring-npm/package-json) for more on package configs. | ||
| 263 | 263 | ||
| 264 | 264 | #### current lifecycle event | |
| 265 | 265 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ description: Working with workspaces | |||
| 8 | 8 | ||
| 9 | 9 | **Workspaces** is a generic term that refers to the set of features in the | |
| 10 | 10 | npm cli that provides support to managing multiple packages from your local | |
| 11 | - files system from within a singular top-level, root package. | ||
| 11 | + file system from within a singular top-level, root package. | ||
| 12 | 12 | ||
| 13 | 13 | This set of features makes up for a much more streamlined workflow handling | |
| 14 | 14 | linked packages from the local file system. Automating the linking process | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3> | |||
| 160 | 160 | the results to only the paths to the packages named. Note that nested | |
| 161 | 161 | packages will <em>also</em> show the paths to the specified packages. For | |
| 162 | 162 | example, running <code>npm ls promzard</code> in npm's source tree will show:</p> | |
| 163 | - <pre lang="bash"><code>npm@8.1.4 /path/to/npm | ||
| 163 | + <pre lang="bash"><code>npm@8.2.0 /path/to/npm | ||
| 164 | 164 | └─┬ init-package-json@0.0.4 | |
| 165 | 165 | └── promzard@0.1.5 | |
| 166 | 166 | </code></pre> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 149 | 149 | <pre lang="bash"><code>npm <command> [args] | |
| 150 | 150 | </code></pre> | |
| 151 | 151 | <h3 id="version">Version</h3> | |
| 152 | - <p>8.1.4</p> | ||
| 152 | + <p>8.2.0</p> | ||
| 153 | 153 | <h3 id="description">Description</h3> | |
| 154 | 154 | <p>npm is the package manager for the Node JavaScript platform. It puts | |
| 155 | 155 | modules in place so that node can find them, and manages dependency | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -962,8 +962,8 @@ <h4 id="loglevel"><code>loglevel</code></h4> | |||
| 962 | 962 | <li>Type: "silent", "error", "warn", "notice", "http", "timing", "info", | |
| 963 | 963 | "verbose", or "silly"</li> | |
| 964 | 964 | </ul> | |
| 965 | - <p>What level of logs to report. On failure, <em>all</em> logs are written to | ||
| 966 | - <code>npm-debug.log</code> in the current working directory.</p> | ||
| 965 | + <p>What level of logs to report. All logs are written to a debug log, with the | ||
| 966 | + path to that file printed if the execution of a command fails.</p> | ||
| 967 | 967 | <p>Any logs of a higher level than the setting are shown. The default is | |
| 968 | 968 | "notice".</p> | |
| 969 | 969 | <p>See also the <code>foreground-scripts</code> config.</p> | |
@@ -1259,7 +1259,7 @@ <h4 id="save-peer"><code>save-peer</code></h4> | |||
| 1259 | 1259 | <li>Default: false</li> | |
| 1260 | 1260 | <li>Type: Boolean</li> | |
| 1261 | 1261 | </ul> | |
| 1262 | - <p>Save installed packages. to a package.json file as <code>peerDependencies</code></p> | ||
| 1262 | + <p>Save installed packages to a package.json file as <code>peerDependencies</code></p> | ||
| 1263 | 1263 | <!-- raw HTML omitted --> | |
| 1264 | 1264 | <!-- raw HTML omitted --> | |
| 1265 | 1265 | <h4 id="save-prefix"><code>save-prefix</code></h4> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,203 @@ | |||
| 1 | + <!DOCTYPE html><html><head> | ||
| 2 | + <meta charset="utf-8"> | ||
| 3 | + <title>Logging</title> | ||
| 4 | + <style> | ||
| 5 | + body { | ||
| 6 | + background-color: #ffffff; | ||
| 7 | + color: #24292e; | ||
| 8 | + | ||
| 9 | + margin: 0; | ||
| 10 | + | ||
| 11 | + line-height: 1.5; | ||
| 12 | + | ||
| 13 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; | ||
| 14 | + } | ||
| 15 | + #rainbar { | ||
| 16 | + height: 10px; | ||
| 17 | + background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + a { | ||
| 21 | + text-decoration: none; | ||
| 22 | + color: #0366d6; | ||
| 23 | + } | ||
| 24 | + a:hover { | ||
| 25 | + text-decoration: underline; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + pre { | ||
| 29 | + margin: 1em 0px; | ||
| 30 | + padding: 1em; | ||
| 31 | + border: solid 1px #e1e4e8; | ||
| 32 | + border-radius: 6px; | ||
| 33 | + | ||
| 34 | + display: block; | ||
| 35 | + overflow: auto; | ||
| 36 | + | ||
| 37 | + white-space: pre; | ||
| 38 | + | ||
| 39 | + background-color: #f6f8fa; | ||
| 40 | + color: #393a34; | ||
| 41 | + } | ||
| 42 | + code { | ||
| 43 | + font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; | ||
| 44 | + font-size: 85%; | ||
| 45 | + padding: 0.2em 0.4em; | ||
| 46 | + background-color: #f6f8fa; | ||
| 47 | + color: #393a34; | ||
| 48 | + } | ||
| 49 | + pre > code { | ||
| 50 | + padding: 0; | ||
| 51 | + background-color: inherit; | ||
| 52 | + color: inherit; | ||
| 53 | + } | ||
| 54 | + h1, h2, h3 { | ||
| 55 | + font-weight: 600; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + #logobar { | ||
| 59 | + background-color: #333333; | ||
| 60 | + margin: 0 auto; | ||
| 61 | + padding: 1em 4em; | ||
| 62 | + } | ||
| 63 | + #logobar .logo { | ||
| 64 | + float: left; | ||
| 65 | + } | ||
| 66 | + #logobar .title { | ||
| 67 | + font-weight: 600; | ||
| 68 | + color: #dddddd; | ||
| 69 | + float: left; | ||
| 70 | + margin: 5px 0 0 1em; | ||
| 71 | + } | ||
| 72 | + #logobar:after { | ||
| 73 | + content: ""; | ||
| 74 | + display: block; | ||
| 75 | + clear: both; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + #content { | ||
| 79 | + margin: 0 auto; | ||
| 80 | + padding: 0 4em; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + #table_of_contents > h2 { | ||
| 84 | + font-size: 1.17em; | ||
| 85 | + } | ||
| 86 | + #table_of_contents ul:first-child { | ||
| 87 | + border: solid 1px #e1e4e8; | ||
| 88 | + border-radius: 6px; | ||
| 89 | + padding: 1em; | ||
| 90 | + background-color: #f6f8fa; | ||
| 91 | + color: #393a34; | ||
| 92 | + } | ||
| 93 | + #table_of_contents ul { | ||
| 94 | + list-style-type: none; | ||
| 95 | + padding-left: 1.5em; | ||
| 96 | + } | ||
| 97 | + #table_of_contents li { | ||
| 98 | + font-size: 0.9em; | ||
| 99 | + } | ||
| 100 | + #table_of_contents li a { | ||
| 101 | + color: #000000; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + header.title { | ||
| 105 | + border-bottom: solid 1px #e1e4e8; | ||
| 106 | + } | ||
| 107 | + header.title > h1 { | ||
| 108 | + margin-bottom: 0.25em; | ||
| 109 | + } | ||
| 110 | + header.title > .description { | ||
| 111 | + display: block; | ||
| 112 | + margin-bottom: 0.5em; | ||
| 113 | + line-height: 1; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + footer#edit { | ||
| 117 | + border-top: solid 1px #e1e4e8; | ||
| 118 | + margin: 3em 0 4em 0; | ||
| 119 | + padding-top: 2em; | ||
| 120 | + } | ||
| 121 | + </style> | ||
| 122 | + </head> | ||
| 123 | + <body> | ||
| 124 | + <div id="banner"> | ||
| 125 | + <div id="rainbar"></div> | ||
| 126 | + <div id="logobar"> | ||
| 127 | + <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700"> | ||
| 128 | + <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon> | ||
| 129 | + <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon> | ||
| 130 | + </svg> | ||
| 131 | + <div class="title"> | ||
| 132 | + npm command-line interface | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + </div> | ||
| 136 | + | ||
| 137 | + <section id="content"> | ||
| 138 | + <header class="title"> | ||
| 139 | + <h1 id="logging">Logging</h1> | ||
| 140 | + <span class="description">Why, What & How we Log</span> | ||
| 141 | + </header> | ||
| 142 | + | ||
| 143 | + <section id="table_of_contents"> | ||
| 144 | + <h2 id="table-of-contents">Table of contents</h2> | ||
| 145 | + <div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#setting-log-levels">Setting Log Levels</a></li><ul><li><a href="#loglevel"><code>loglevel</code></a></li><ul><li><a href="#aliases">Aliases</a></li></ul><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li></ul><li><a href="#registry-response-headers">Registry Response Headers</a></li><ul><li><a href="#npm-notice"><code>npm-notice</code></a></li></ul><li><a href="#see-also">See also</a></li></ul></div> | ||
| 146 | + </section> | ||
| 147 | + | ||
| 148 | + <div id="_content"><h3 id="description">Description</h3> | ||
| 149 | + <p>The <code>npm</code> CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.</p> | ||
| 150 | + <h3 id="setting-log-levels">Setting Log Levels</h3> | ||
| 151 | + <h4 id="loglevel"><code>loglevel</code></h4> | ||
| 152 | + <p><code>loglevel</code> is a global argument/config that can be set to determine the type of information to be displayed.</p> | ||
| 153 | + <p>The default value of <code>loglevel</code> is <code>"notice"</code> but there are several levels/types of logs available, including:</p> | ||
| 154 | + <ul> | ||
| 155 | + <li><code>"silent"</code></li> | ||
| 156 | + <li><code>"error"</code></li> | ||
| 157 | + <li><code>"warn"</code></li> | ||
| 158 | + <li><code>"notice"</code></li> | ||
| 159 | + <li><code>"http"</code></li> | ||
| 160 | + <li><code>"timing"</code></li> | ||
| 161 | + <li><code>"info"</code></li> | ||
| 162 | + <li><code>"verbose"</code></li> | ||
| 163 | + <li><code>"silly"</code></li> | ||
| 164 | + </ul> | ||
| 165 | + <p>All logs pertaining to a level proceeding the current setting will be shown.</p> | ||
| 166 | + <p>All logs are written to a debug log, with the path to that file printed if the execution of a command fails.</p> | ||
| 167 | + <h5 id="aliases">Aliases</h5> | ||
| 168 | + <p>The log levels listed above have various corresponding aliases, including:</p> | ||
| 169 | + <ul> | ||
| 170 | + <li><code>-d</code>: <code>--loglevel info</code></li> | ||
| 171 | + <li><code>--dd</code>: <code>--loglevel verbose</code></li> | ||
| 172 | + <li><code>--verbose</code>: <code>--loglevel verbose</code></li> | ||
| 173 | + <li><code>--ddd</code>: <code>--loglevel silly</code></li> | ||
| 174 | + <li><code>-q</code>: <code>--loglevel warn</code></li> | ||
| 175 | + <li><code>--quiet</code>: <code>--loglevel warn</code></li> | ||
| 176 | + <li><code>-s</code>: <code>--loglevel silent</code></li> | ||
| 177 | + <li><code>--silent</code>: <code>--loglevel silent</code></li> | ||
| 178 | + </ul> | ||
| 179 | + <h4 id="foreground-scripts"><code>foreground-scripts</code></h4> | ||
| 180 | + <p>The <code>npm</code> CLI began hiding the output of lifecycle scripts for <code>npm install</code> as of <code>v7</code>. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in <code>package.json</code>. If you'd like to change this behavior & log this output you can set <code>foreground-scripts</code> to <code>true</code>.</p> | ||
| 181 | + <h3 id="registry-response-headers">Registry Response Headers</h3> | ||
| 182 | + <h4 id="npm-notice"><code>npm-notice</code></h4> | ||
| 183 | + <p>The <code>npm</code> CLI reads from & logs any <code>npm-notice</code> headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.</p> | ||
| 184 | + <p>This header is not cached, and will not be logged if the request is served from the cache.</p> | ||
| 185 | + <h3 id="see-also">See also</h3> | ||
| 186 | + <ul> | ||
| 187 | + <li><a href="../using-npm/config.html">config</a></li> | ||
| 188 | + </ul> | ||
| 189 | + </div> | ||
| 190 | + | ||
| 191 | + <footer id="edit"> | ||
| 192 | + <a href="https://github.com/npm/cli/edit/latest/docs/content/using-npm/logging.md"> | ||
| 193 | + <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;"> | ||
| 194 | + <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path> | ||
| 195 | + </svg> | ||
| 196 | + Edit this page on GitHub | ||
| 197 | + </a> | ||
| 198 | + </footer> | ||
| 199 | + </section> | ||
| 200 | + | ||
| 201 | + | ||
| 202 | + | ||
| 203 | + </body></html> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -380,7 +380,7 @@ <h4 id="packagejson-vars">package.json vars</h4> | |||
| 380 | 380 | <code>npm_package_version</code> set to "1.2.5". You can access these variables | |
| 381 | 381 | in your code with <code>process.env.npm_package_name</code> and | |
| 382 | 382 | <code>process.env.npm_package_version</code>, and so on for other fields.</p> | |
| 383 | - <p>See <a href="../configuring-npm/package-json.html"><code>package-json.md</code></a> for more on package configs.</p> | ||
| 383 | + <p>See <a href="../configuring-npm/package-json.html"><code>package.json</code></a> for more on package configs.</p> | ||
| 384 | 384 | <h4 id="current-lifecycle-event">current lifecycle event</h4> | |
| 385 | 385 | <p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to | |
| 386 | 386 | whichever stage of the cycle is being executed. So, you could have a | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 148 | 148 | <div id="_content"><h3 id="description">Description</h3> | |
| 149 | 149 | <p><strong>Workspaces</strong> is a generic term that refers to the set of features in the | |
| 150 | 150 | npm cli that provides support to managing multiple packages from your local | |
| 151 | - files system from within a singular top-level, root package.</p> | ||
| 151 | + file system from within a singular top-level, root package.</p> | ||
| 152 | 152 | <p>This set of features makes up for a much more streamlined workflow handling | |
| 153 | 153 | linked packages from the local file system. Automating the linking process | |
| 154 | 154 | as part of <code>npm install</code> and avoiding manually having to use <code>npm link</code> in | |
| Back | FazBrowse Home | New Git URL |
0 commit comments