cli icon indicating copy to clipboard operation
cli copied to clipboard

Getting weird superfluous log for every invocation of `npm ...`: `config:load:flatten`

Open TimDaub opened this issue 2 years ago • 9 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

every call that I make with npm ... e.g. calling a script npm run connect, there is this weird looking log that makes no sense in this context:

(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ : timing config:load:flatten Completed in 2ms

E.g. I have npm run connect setup where it connects to a preconfigured server, but this annoying log doesn't allow me to read the buffer. This happens across different workspaces with different npm package.json files too!

Expected Behavior

log should not appear

Steps To Reproduce

I'm not sure how this came to be...

Environment

  • npm: 8.11.0
  • Node.js: 16.15.1
  • OS Name: mac os 12.2.1
  • System Model Name:
  • npm config:
npm config ls
npm WARN config init.author.name Use `--init-author-name` instead.
npm WARN config init.author.email Use `--init-author-email` instead.
npm WARN config init.author.url Use `--init-author-url` instead.
; "user" config from /Users/timdaub/.npmrc

//registry.npmjs.org/:_authToken = (protected)
email = "myemail"
init.author.email = "="
init.author.name = "Tim Daubenschütz <myemail>"
init.author.url = "https://timdaub.github.io/"
prefix = "/usr/local"
save-exact = true
save-prefix = ""

TimDaub avatar Jun 15 '22 17:06 TimDaub

After using n to switch between node versions, e.g. n v14, I found that with other versions of npm this problem isn't occurring e.g.

npm -v
6.14.17

TimDaub avatar Jun 16 '22 07:06 TimDaub

I'm having the same issue after updating node yesterday.

npm 8.3.1 does not do this, 8.12.1 does

zinkem avatar Jun 18 '22 01:06 zinkem

same issue here after switching node/npm version with nvm now on any npm command this bar appears

2022:06:24:15:14:48

currently using:

npm: '8.12.1' (also happens on 8.13.1)
node: '16.13.1',

joaovitorzv avatar Jun 24 '22 18:06 joaovitorzv

@joaovitorzv what about on the real terminal, as opposed to the vscode one?

ljharb avatar Jun 24 '22 18:06 ljharb

@joaovitorzv what about on the real terminal, as opposed to the vscode one?

also happens, on the screenshot I tested on gnome-terminal + bash and xfce4-terminal + zsh

2022:06:24:21:48:01

joaovitorzv avatar Jun 25 '22 00:06 joaovitorzv

The config:load:flatten message stopped appearing for me after resolving all npm warnings.

In my case I had to comment out several deprecated/unused variables from my .npmrc file.

 % nvm use 18
Now using node v18.4.0 (npm v8.12.1)

zinkem avatar Jun 25 '22 01:06 zinkem

I had the same problems, caused by an old .npmrc file left in a workspace (WARN ignoring workspace config at /path/to/.npmrc).

This was solved by removing the file.

timothee-alby avatar Jul 07 '22 12:07 timothee-alby

Thank you op for asking the question & Zinkem for the suggested fix, I've had a repo that suddenly wouldn't start angular in dev mode last week. Not sure which NPM I had installed but probably 8.14.0 (on node 16.16.0) and no one else in the company was having the same problem. Dropped my NPM to 8.3.1 and bam it works.

After some trial and error it looks like for my win10 64-bit machine running node 16.16.0, any NPM 8.7 & above has this error. Another who is a mac user is on node 16.15.0 with NPM 8.11.0 and has no problems.

drfish avatar Jul 21 '22 19:07 drfish

Same issue here, getting a cryptic "warning" when starting a project with npm run start:

npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.

No idea what the warning is about, and even if it were important, why, for the rest of the program execution, show this weird progress bar (always at 100% fill), stuck to the bottom of the output?

(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ : timing config:load:flatten Completed in 3ms

webhype avatar Aug 03 '22 16:08 webhype

I had the same with node 16.16.0, npm 8.11.0

Go through your .npmrc and workout what line causes the issues. For me it was init.author.name should be init-author-name and the same for the other init.author lines i had

ghost avatar Aug 22 '22 09:08 ghost

Seeing the same problem. My .npmrc only has registry and always-auth properties.

  • Commenting out both lines have no effect.
  • Deleting the file fixed the problem.

Given that I still need the content in the .npmrc, there is no known workaround. Any help from the CLI team please?

  • Node: v16.16.0
  • npm: 8.11.0

chuanqisun avatar Aug 22 '22 20:08 chuanqisun

It would be helpful if anyone finding this problem could paste the output of running: npm config ls in their project's folder. That might provide some hint in case it's a config problem.

ruyadorno avatar Aug 29 '22 14:08 ruyadorno

Here is npm config ls output:

node ➜ /workspaces/HITS-Modern (master) $ npm config ls
; "user" config from /home/node/.npmrc

//pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/:_password = (protected) 
//pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/:email = "[email protected]" 
//pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/:username = "microsoft" 
//pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/registry/:_password = (protected) 
//pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/registry/:username = "microsoft" 
email = "[email protected]" 

; "project" config from /workspaces/HITS-Modern/.npmrc

always-auth = true 
registry = "https://pkgs.dev.azure.com/microsoft/44933269-136c-418b-ad90-9caee8d75ee5/_packaging/hits/npm/registry/" 

; node bin location = /usr/local/share/nvm/versions/node/v16.17.0/bin/node
; node version = v16.17.0
; npm local prefix = /workspaces/HITS-Modern
; npm version = 8.15.0
; cwd = /workspaces/HITS-Modern
; HOME = /home/node
; Run `npm config ls -l` to show all defaults.

Also attaching screenshot showing the problematic console artifacts image

chuanqisun avatar Aug 30 '22 18:08 chuanqisun

Thanks for the reports everyone! I'm fairly sure this is a duplicate of #4527, so I'm going to close this one. If you think that is a mistake, please let me know.

lukekarrys avatar Sep 01 '22 15:09 lukekarrys

Maybe it is a duplicate, but according to a comment on that ticket we should only be getting this timing message if we're getting a warning about it ignoring namespace configuration.

I can't speak for anyone else, but I know I'm not getting such a warning & still seeing the timing warning if I go to the current latest (8.19.2). 🤷

drfish avatar Sep 22 '22 20:09 drfish

ansf's answer from #4527 helped me. After removing the .npmrc files in the child packages and only keeping one .npmrc at the root, I was able to get rid of both the the warning npm WARN ignoring workspace ... and the timing config:load:flatten artifacts.

chuanqisun avatar Nov 07 '22 23:11 chuanqisun

Adding progress=false to my global .npmrc file solved this issue for me

hansogj avatar Nov 10 '22 06:11 hansogj

Adding progress=false to my global .npmrc file solved this issue for me

Thanks, this works for me too

Naama-Hadas avatar Nov 16 '22 20:11 Naama-Hadas

I solved this issue. In conclusion, there are 2 solutions:

  1. From node 18, npm set default 8.x.x version. Downgrade npm to older version will resolve this issue

npm install -g npm@6

  1. Follow this answer of hansogj. Thank very much for your solution

Adding progress=false to my global .npmrc file solved this issue for me

greeneley avatar Dec 11 '22 09:12 greeneley

In Windows and Mac osx go to folder /Users/your-user-name/ and delete the file .npmrc or add progress=false

lambdaily avatar Dec 25 '22 19:12 lambdaily

Same problem. Same solution. Thanks everyone.

AWRootbeard avatar Dec 30 '22 05:12 AWRootbeard

In my case I had in .npmrc config: _auth='TOKEN' 👎

instead of //package-registry.mycompany.com/:_auth='TOKEN' 👍

AlexMelw avatar Oct 05 '23 09:10 AlexMelw