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

Don't override user specified depth in outdated #239

Closed
wants to merge 1 commit into from

Conversation

@G-Rath
Copy link
Contributor

commented Aug 25, 2019

Restores ability to update packages using --depth as suggested by npm audit.

i.e npm update eslint-utils --depth 2.


I've restored the previous conditional check, which was against Infinity; however I've never worked in npm/cli before, so don't know if that value still holds water :)

How it is currently means the npm update <package> --depth <depth> commands suggested by npm audit won't work, as any depth value is clobbered to 0 if it's anything but, resulting in empty output.

This is the related community bug report.


Since this was included in v6.6.0 onwards, it effects all versions of Node from 11.10.0 onwards, as well as 10.16.0+

Restores ability to update packages using `--depth` as suggested by `npm audit`.

i.e `npm update eslint-utils --depth 2`.
@G-Rath G-Rath requested a review from npm/cli-team as a code owner Aug 25, 2019
@shadowspawn

This comment has been minimized.

Copy link

commented Aug 25, 2019

I came across another PR related to infinity regressions which casts a little light on the original use of the infinity magic value to have different default behaviours in different commands: npm/npm#11726

(And like @G-Rath, not sure if that value is still relevant!)

@isaacs isaacs self-assigned this Aug 26, 2019
@isaacs isaacs added the semver:patch label Aug 26, 2019
@isaacs

This comment has been minimized.

Copy link
Member

commented Aug 26, 2019

Thanks, this is definitely a bug.

@billatnpm

This comment has been minimized.

Copy link

commented Aug 29, 2019

https://docs.npmjs.com/misc/config#depth

For npm outdated, a setting of Infinity will be treated as 0 since that gives more useful information. To show the outdated status of all packages and dependents, use a large integer value, e.g., npm outdated --depth 9999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.