Skip to content

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

Description

@tim-janik

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

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    Release 7.xwork is associated with a specific npm 7 release
    on May 27, 2021
  2. added
    Priority 2secondary priority issue
    and removed
    Needs Triageneeds review for next steps
    on May 28, 2021
  3. johnnymajor commented on Jul 1, 2021

    @johnnymajor

    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

  4. trallnag commented on Dec 24, 2021

    @trallnag

    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)

  5. added a commit that references this issue on Mar 30, 2022
    78fc0c1
  6. added a commit that references this issue on Mar 31, 2022
    668ec7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions