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

[BUG] unexpected change in behavior of npm view --json of invalid version of a package #1639

Closed
MylesBorins opened this issue Aug 7, 2020 · 3 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@MylesBorins
Copy link
Contributor

Current Behavior:

$ npm view --json lodash@0.0.0
undefined
$

Expected Behavior:

In previous versions of npm there would be no content returned

$ npm view --json lodash@0.0.0
$

Steps To Reproduce:

Run above commands

Environment:

OSX 10.15.6
Node.js v14.6.0
npm v7.0.0-beta.2

@MylesBorins MylesBorins added Release 7.x work is associated with a specific npm 7 release Bug thing that needs fixing Needs Triage needs review for next steps labels Aug 7, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Aug 10, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 13 milestone Aug 10, 2020
@darcyclarke
Copy link
Contributor

This should be addressed when we land: #1657

@MylesBorins
Copy link
Contributor Author

MylesBorins commented Sep 1, 2020

This has not been entirely fixed

npm v6.x output

[~]$ npm view --json lodash@0.0.0
[~]$

npm 7.x output

[~]$ npm view --json lodash@0.0.0

[~]$

Notice the additional newline that we have now. This is probably a non issue for most cases but it did break some internals on CITGM (but were patched easily enough)

@darcyclarke darcyclarke assigned darcyclarke and unassigned claudiahdz Sep 3, 2020
MylesBorins added a commit to MylesBorins/cli that referenced this issue Sep 10, 2020
Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: npm#1639
MylesBorins added a commit to MylesBorins/cli that referenced this issue Sep 10, 2020
Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: npm#1639
MylesBorins added a commit to MylesBorins/cli that referenced this issue Sep 10, 2020
Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: npm#1639
ruyadorno pushed a commit that referenced this issue Sep 16, 2020
Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: #1639

PR-URL: #1791
Credit: @MylesBorins
Close: #1791
Reviewed-by: @ruyadorno
@ruyadorno
Copy link
Contributor

landed in v7.0.0-beta.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants