-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
When I run any npm related command I got a new debug log file created, which is kinda annoying.
How can prevent the debug log files being created after each npm command?
Form example when I run npm -v, I got a new log file with the following output:
0 verbose cli [
0 verbose cli '/usr/local/Cellar/node/17.3.0/bin/node',
0 verbose cli '/usr/local/bin/npm',
0 verbose cli '-v'
0 verbose cli ]
1 info using npm@8.3.0
2 info using node@v17.3.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 5ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 3ms
10 timing config:load:file:/Users/(protected)/.npmrc Completed in 1ms
11 timing config:load:user Completed in 2ms
12 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 1ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 16ms
18 timing npm:load:configload Completed in 17ms
19 timing npm:load:setTitle Completed in 2ms
20 timing config:load:flatten Completed in 2ms
21 timing npm:load:display Completed in 4ms
22 verbose logfile /Users/(protected)/.npm/_logs/2022-01-04T19_56_27_927Z-debug-0.log
23 timing npm:load:logFile Completed in 4ms
24 timing npm:load:timers Completed in 0ms
25 timing npm:load:configScope Completed in 0ms
26 timing npm:load Completed in 27ms
27 verbose exit 0
28 timing npm Completed in 316ms
29 info ok
When I start some node app with npm run dev (for example, some Nuxt.js app), again I got a new log file:
0 verbose cli [
0 verbose cli '/usr/local/Cellar/node/17.3.0/bin/node',
0 verbose cli '/usr/local/bin/npm',
0 verbose cli 'run',
0 verbose cli 'dev'
0 verbose cli ]
1 info using npm@8.3.0
2 info using node@v17.3.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 3ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/(protected)/.../(protected)/.npmrc Completed in 2ms
10 timing config:load:project Completed in 5ms
11 timing config:load:file:/Users/(protected)/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 17ms
19 timing npm:load:configload Completed in 17ms
20 timing npm:load:setTitle Completed in 3ms
21 timing config:load:flatten Completed in 3ms
22 timing npm:load:display Completed in 4ms
23 verbose logfile /Users/(protected)/.npm/_logs/2022-01-04T18_20_49_151Z-debug-0.log
24 timing npm:load:logFile Completed in 6ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 31ms
And so on - I got a new log file for every command, not only for errors or warnings.
My global .npmrc file has no extra settings.
Even if I add to it `loglevel=silent' I still have the new log files, but the info in the terminal is being cut off.
Any ideas to prevent these verbose log files being created and keep them only for errors and warning?
Expected Behavior
Not to have a verbose log file for each npm command.
Steps To Reproduce
No response
Environment
- npm: 8.3.0
- Node: 17.3.0 installed with HomeBrew
- OS: MacOS
- platform: MacBook Pro
- npm config:
npm config ls:
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc
prefix = "/usr/local"
; "user" config from /Users/(protected)/.npmrc
; node bin location = /usr/local/Cellar/node/17.3.0/bin/node
; cwd = /Users/(protected)
; HOME = /Users/(protected)npm config ls -l:
; "default" config from default values
_auth = (protected)
access = null
all = false
allow-same-version = false
also = null
audit = true
audit-level = null
auth-type = "legacy"
before = null
bin-links = true
browser = null
ca = null
cache = "/Users/(protected)/.npm"
cache-max = null
cache-min = 0
cafile = null
call = ""
cert = null
ci-name = null
cidr = null
color = true
commit-hooks = true
depth = null
description = true
dev = false
diff = []
diff-dst-prefix = "b/"
diff-ignore-all-space = false
diff-name-only = false
diff-no-prefix = false
diff-src-prefix = "a/"
diff-text = false
diff-unified = 3
dry-run = false
editor = "vi"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
fetch-timeout = 300000
force = false
foreground-scripts = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "/usr/local/etc/npmrc"
heading = "npm"
https-proxy = null
if-present = false
ignore-scripts = false
include = []
include-staged = false
include-workspace-root = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "/Users/(protected)/.npm-init.js"
init-version = "1.0.0"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.license = "ISC"
init.module = "/Users/(protected)/.npm-init.js"
init.version = "1.0.0"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
link = false
local-address = null
location = "user"
lockfile-version = null
loglevel = "notice"
logs-max = 10
; long = false ; overridden by cli
maxsockets = 15
message = "%s"
metrics-registry = "https://registry.npmjs.org/"
node-options = null
node-version = "v17.3.0"
noproxy = [""]
npm-version = "8.3.0"
offline = false
omit = []
only = null
optional = null
otp = null
pack-destination = "."
package = []
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
; prefix = "/usr/local/Cellar/node/17.3.0" ; overridden by builtin
preid = ""
production = null
progress = true
proxy = null
read-only = false
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-peer = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
searchexclude = ""
searchlimit = 20
searchopts = ""
searchstaleness = 900
shell = "/usr/local/bin/zsh"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
sso-poll-frequency = 500
sso-type = "oauth"
strict-peer-deps = false
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "/var/folders/hr/bbbmspwn0pbbhplv4jpt6vcc0000gn/T"
umask = 0
unicode = true
update-notifier = true
usage = false
user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
userconfig = "/Users/(protected)/.npmrc"
version = false
versions = false
viewer = "man"
which = null
workspace = []
workspaces = null
yes = null
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc
prefix = "/usr/local"
; "user" config from /Users/(protected)/.npmrc
; "cli" config from command line options
long = true