cli
cli copied to clipboard
Getting weird superfluous log for every invocation of `npm ...`: `config:load:flatten`
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 = ""
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
I'm having the same issue after updating node yesterday.
npm 8.3.1
does not do this, 8.12.1
does
same issue here after switching node/npm version with nvm
now on any npm command this bar appears
currently using:
npm: '8.12.1' (also happens on 8.13.1)
node: '16.13.1',
@joaovitorzv what about on the real terminal, as opposed to the vscode one?
@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
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)
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.
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.
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
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
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
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.
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
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.
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). 🤷
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.
Adding progress=false
to my global .npmrc file solved this issue for me
Adding
progress=false
to my global .npmrc file solved this issue for me
Thanks, this works for me too
I solved this issue. In conclusion, there are 2 solutions:
- From node 18, npm set default 8.x.x version. Downgrade npm to older version will resolve this issue
npm install -g npm@6
- Follow this answer of hansogj. Thank very much for your solution
Adding
progress=false
to my global .npmrc file solved this issue for me
In Windows and Mac osx go to folder /Users/your-user-name/ and delete the file .npmrc or add progress=false
Same problem. Same solution. Thanks everyone.
In my case I had in .npmrc config:
_auth='TOKEN'
👎
instead of
//package-registry.mycompany.com/:_auth='TOKEN'
👍