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] Cannot read properties of undefined (reading 'description') #5961

Open
2 tasks done
vrubezhny opened this issue Dec 13, 2022 · 1 comment · May be fixed by #5962
Open
2 tasks done

[BUG] Cannot read properties of undefined (reading 'description') #5961

vrubezhny opened this issue Dec 13, 2022 · 1 comment · May be fixed by #5962
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@vrubezhny
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

For some dependencies in a project's package.json a TypeError occurs when npm ll -a is executed.
For example,, if package.json contains the following dependenciy:

{
  "dependencies": {
    "ws": "8.11.0"
  }
}

the following error occurs when executing npm ll -a:

$ npm --version
8.19.2
$ npm ll -a
npm ERR! Cannot read properties of undefined (reading 'description')

npm ERR! A complete log of this run can be found in:
npm ERR!   ~`.npm/_logs/2022-12-13T20_36_19_543Z-debug-0.log

while the log file contains the following stacktrace:

9 verbose stack TypeError: Cannot read properties of undefined (reading 'description')
39 verbose stack     at getHumanOutputItem (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/lib/commands/ls.js:339:35)
39 verbose stack     at visit (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/lib/commands/ls.js:160:15)
39 verbose stack     at visitNode (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/treeverse/lib/breadth.js:37:25)
39 verbose stack     at next (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/treeverse/lib/breadth.js:23:19)
39 verbose stack     at ~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/node_modules/treeverse/lib/breadth.js:25:31
39 verbose stack     at async LL.exec (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/lib/commands/ls.js:122:20)
39 verbose stack     at async module.exports (~/.nvm/versions/node/v18.12.1/lib/node_modules/npm/lib/cli.js:78:5)

Expected Behavior

Full dependency tree to be printed for a project

Steps To Reproduce

  1. Tested on Linux with NPM v.8.19.2
  2. With a project that has a dependency like the following:
{
  "dependencies": {
    "ws": "8.11.0"
  }
}
  1. Run 'npm ll -a'
  2. See error...

Environment

  • npm: 8.19.2
  • Node.js: v18.12.1
  • OS Name:Fedora Linux 36 (Workstation Edition)
@pniederlag
Copy link

this is a quite annoying bug that seems to affect almost any nodejs/npm version

node 15.14.0 npm 7.7.6
node 16.20.0 npm 8.19.4
node 18.16.0 npm 9.5.1
node 20.5.1 npm 9.8.0

anything we can do to get this fixed? #5962 seems good to me

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

Successfully merging a pull request may close this issue.

2 participants