Skip to content

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

@tim-janik

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

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