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

fix: npm ls --parseable --long output #1547

Closed
wants to merge 1 commit into from

Conversation

ruyadorno
Copy link
Contributor

Fixes npm ls --parseable --long printing undefined next to all items.

Test

# Given a project structure:
ruyadorno@macbookpro ~/Documents/workspace/tmp \tree
.
├── c
│   └── package.json
├── node_modules
│   ├── a
│   │   └── package.json
│   ├── b
│   │   └── package.json
│   ├── c -> /Users/ruyadorno/Documents/workspace/tmp/c/
│   └── d
│       └── package.json
└── package.json

6 directories, 5 files

# BEFORE
ruyadorno@macbookpro ~/Documents/workspace/tmp npm6 ls --parseable --long
/Users/ruyadorno/Documents/workspace/tmp:[email protected]:undefined
/Users/ruyadorno/Documents/workspace/tmp/node_modules/a:[email protected]:undefined
/Users/ruyadorno/Documents/workspace/tmp/node_modules/b:[email protected]:undefined
/Users/ruyadorno/Documents/workspace/tmp/node_modules/c:[email protected]:undefined
/Users/ruyadorno/Documents/workspace/tmp/node_modules/d:[email protected]:undefined
/Users/ruyadorno/Documents/workspace/tmp/node_modules/f:f@"^2.0.0":INVALID:MISSING

# AFTER
ruyadorno@macbookpro ~/Documents/workspace/tmp node ~/Documents/workspace/cli/latest ls --parseable --long
/Users/ruyadorno/Documents/workspace/tmp:[email protected]
/Users/ruyadorno/Documents/workspace/tmp/node_modules/a:[email protected]
/Users/ruyadorno/Documents/workspace/tmp/node_modules/b:[email protected]
/Users/ruyadorno/Documents/workspace/tmp/node_modules/c:[email protected]:/Users/ruyadorno/Documents/workspace/tmp/c
/Users/ruyadorno/Documents/workspace/tmp/node_modules/d:[email protected]
/Users/ruyadorno/Documents/workspace/tmp/node_modules/f:f@"^2.0.0":INVALID:MISSING

@ruyadorno ruyadorno requested a review from a team as a code owner July 21, 2020 16:52
@ruyadorno ruyadorno added Release 6.x work is associated with a specific npm 6 release semver:patch semver patch level for changes labels Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release 6.x work is associated with a specific npm 6 release semver:patch semver patch level for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant