cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] npm produces "timing" log output when "npm start"

Open Ognian opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

This issue exists in the latest npm version

  • [X] I am using the latest npm

Current Behavior

' npm start ' produces the following timing output which sticks always to the last line: image the "normal" output from the started app is always scrolling above this last line.

Expected Behavior

no timing output.

Digging deeper I noticed that with --loglevel silentor error there is no sticky output. BUT for warn , notice and http there is timing output which in my opinion should not happen, since these levels are before timing log level ....

Steps To Reproduce

  1. npm start
  2. See error...

Environment

  • npm: 8.5.3
  • Node.js: 17.6.0
  • OS Name: macOS 12.2.1
  • System Model Name: Macbook Pro
  • npm config:
npm config ls
npm WARN ignoring workspace config at /Users/ogi/Repositories/IMS/IMS_v2/packages/mims-test/.npmrc 
npm WARN config This command does not support workspaces.
; "user" config from /Users/ogi/.npmrc

; @ogi-it:registry = "http://localhost:4873/" ; overridden by project
//localhost:4873/:_authToken = (protected) 
//registry.npmjs.org/:_authToken = (protected) 
scripts-prepend-node-path = true 

; "project" config from /Users/ogi/Repositories/IMS/IMS_v2/.npmrc

@ogi-it:registry = "http://localhost:4873" 

; node bin location = /usr/local/bin/node
; cwd = /Users/ogi/Repositories/IMS/IMS_v2/packages/mims-test
; HOME = /Users/ogi
; Run `npm config ls -l` to show all defaults.
ogi@ogi-it-mac mims-test % 

Ognian avatar Mar 09 '22 18:03 Ognian

I noticed something similar and I observed that the timing information is only printed if there is some warning output happening before.

In your case:

npm WARN ignoring workspace config at /Users/ogi/Repositories/IMS/IMS_v2/packages/mims-test/.npmrc

I think if you are using npm workspaces, you only need an .npmrc at the workspace root.

ansf avatar Mar 23 '22 17:03 ansf

@ansf you are totally right! That is indeed the cause of the timing info. Thank you! Ognian

Ognian avatar Mar 24 '22 10:03 Ognian

@ansf you are totally right! That is indeed the cause of the timing info. Thank you! Ognian

@Ognian how is an otherwise harmless warning the "cause" of a useless flickering progress bar, destroying my terminal output? Is there a workaround for existing npm installations?

webhype avatar Oct 23 '22 16:10 webhype

@webhype As far as I can see the underlying problem was solved with the 8.x version. In my case removing .npmrc files in all subdirectories stopped the output from appearing with the 7.x version of npm.

Ognian avatar Oct 24 '22 11:10 Ognian

What is the fix version for this bug?

synox avatar Jan 05 '23 21:01 synox

I have it on npm version 8.19.2. To remove the annoying thing I set: npm config set progress=false

alehro avatar Jan 16 '23 11:01 alehro

What is the fix version for this bug?

@synox this was fixed in 9.0.0. technically it was fixed in one of the v9 prereleases, but 9.0.0 is the first stable version with the fix.

lukekarrys avatar Jan 18 '23 17:01 lukekarrys