Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TERM=dumb and --no-progress is ignored #3314

Closed
1 task done
tim-janik opened this issue May 27, 2021 · 2 comments · Fixed by #4644 or #4655
Closed
1 task done

TERM=dumb and --no-progress is ignored #3314

tim-janik opened this issue May 27, 2021 · 2 comments · Fixed by #4644 or #4655
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@tim-janik
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Progressbar is shown when it should not:

$ TERM=dumb npm install --progress=false
[         .........] - idealTree: timing idealTree Completed in 388m

Expected Behavior

Progressbar disabling works:

$ TERM=dumb npm install --progress=false
up to date, audited 702 packages in 2s

Steps To Reproduce

The 'progress' config value and TERM=dumb checks work correctly in setup-log.js.
But later on, progress is enabled unconditionally, regardless of the config, here:

./node_modules/@npmcli/arborist/lib/tracker.js:35:        this.log.enableProgress()

Disabling this line fixes the behaviour, so TERM=dumb and --progress=false have an effect again.

Note that there are other places that still disable/enable progress unconditionally without regards to the config setting, these might need review as well:

$ fgrep enableProgress . -rn
./node_modules/@npmcli/arborist/lib/tracker.js:35:        this.log.enableProgress() // <- unconditional progress bar
./node_modules/libnpmexec/lib/run-script.js:82:      log.enableProgress()
./lib/config.js:132:      this.npm.log.enableProgress()
./lib/explore.js:87:      this.npm.log.enableProgress()
./lib/init.js:164:        this.npm.log.enableProgress()

Environment

  • OS: linux
  • npm: 7.14.0
@tim-janik tim-janik added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 27, 2021
@nlf nlf added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels May 28, 2021
@johnnymajor
Copy link

Since postinstall is treated differently using --foreground-scripts helps however the progress bar is now blocking our prompts for more information on install. Any work around to hide the progress bar would be appreciated Thx

@trallnag
Copy link

Just to repeat in here as the other issue has been closed, one current workaround is to pipe the output through tee like this:

npm install --no-progress --prefer-offline 2>&1 | tee

#2560 (comment)

markus456 added a commit to mariadb-corporation/MaxScale that referenced this issue Jul 13, 2022
The --no-progress option would normally be the answer but currently it
is broken due to a bug in NPM: npm/cli#3314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
4 participants