Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Elminate warnings about missing package.json at top level
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed Aug 19, 2015
1 parent 1fa9169 commit 60e44ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/ls.js
Expand Up @@ -146,7 +146,8 @@ function getLite (data, noname) {
lite.problems.push('extraneous: ' + getPackageId(data) + ' ' + (data.path || ''))
}

if (data.error && data.path !== path.resolve(npm.globalDir, '..')) {
if (data.error && data.path !== path.resolve(npm.globalDir, '..') &&
(data.error.code !== 'ENOENT' || noname)) {
lite.invalid = true
lite.problems = lite.problems || []
var message = data.error.message
Expand Down
2 changes: 1 addition & 1 deletion test/tap/ls-l-depth-0.js
Expand Up @@ -77,7 +77,7 @@ test('#6311: npm ll --depth=0 duplicates listing', function (t) {
EXEC_OPTS,
function (err, code, stdout, stderr) {
t.ifError(err, 'npm ll ran without error')
t.is(code, 1, 'npm ll complained about there being no package.json')
t.is(code, 0, 'npm ll exited cleanly')
t.notOk(stderr, 'npm ll ran silently')
t.equal(
stdout,
Expand Down

0 comments on commit 60e44ab

Please sign in to comment.