'npm outdated' throw an error (Cannot read property 'length' of undefined)

What I Wanted to Do

npm --global outdated

What Happened Instead

npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/11.10.1/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   '--loglevel=info',
npm verb cli   '--global',
npm verb cli   '--loglevel=verbose',
npm verb cli   'outdated' ]
npm info using npm@6.9.0
npm info using node@v11.10.1
npm verb npm-session 5426802881b6163c
npm http fetch GET 304 https://registry.npmjs.org/csv2json 360ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/qrcode-terminal 353ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/jsonlint 358ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/modbus-serial 360ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/sleep 362ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/wscat 365ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/forever 376ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/winston 370ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/onoff 375ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ws 375ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-gyp 382ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/moment 385ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/js-beautify 391ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/npm-check-updates 390ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/request 392ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mocha 402ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/serialport 401ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mqtt 413ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/sinon 415ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/express 426ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/eslint 439ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/npm 450ms (from cache)
npm verb stack TypeError: Cannot read property 'length' of undefined
npm verb stack     at dotindex (/Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:59:32)
npm verb stack     at /Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:11:21
npm verb stack     at Array.forEach (<anonymous>)
npm verb stack     at forEach (/Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:73:31)
npm verb stack     at /Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:10:9
npm verb stack     at Array.reduce (<anonymous>)
npm verb stack     at reduce (/Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:63:30)
npm verb stack     at module.exports (/Users/frank/.node/lib/node_modules/npm/node_modules/text-table/index.js:9:20)
npm verb stack     at /Users/frank/.node/lib/node_modules/npm/lib/outdated.js:130:16
npm verb stack     at cb (/Users/frank/.node/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
npm verb stack     at outdated_ (/Users/frank/.node/lib/node_modules/npm/lib/outdated.js:221:12)
npm verb stack     at skip (/Users/frank/.node/lib/node_modules/npm/lib/outdated.js:343:5)
npm verb stack     at updateDeps (/Users/frank/.node/lib/node_modules/npm/lib/outdated.js:446:7)
npm verb stack     at tryCatcher (/Users/frank/.node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm verb stack     at Promise.successAdapter [as _fulfillmentHandler0] (/Users/frank/.node/lib/node_modules/npm/node_modules/bluebird/js/release/nodeify.js:23:30)
npm verb stack     at Promise._settlePromise (/Users/frank/.node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
npm verb cwd /Users/frank
npm verb Darwin 17.7.0
npm verb argv "/usr/local/Cellar/node/11.10.1/bin/node" "/usr/local/bin/npm" "--loglevel=info" "--global" "--loglevel=verbose" "outdated"
npm verb node v11.10.1
npm verb npm  v6.9.0
npm ERR! Cannot read property 'length' of undefined
npm verb exit [ 1, true ]
npm timing npm Completed in 3452ms

Platform Info

$ npm --versions

npm info it worked if it ends with ok
npm info using npm@6.9.0
npm info using node@v11.10.1
{ npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.10.1',
  openssl: '1.1.1a',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.26.0',
  v8: '7.0.276.38-node.17',
  zlib: '1.2.11' }
npm timing npm Completed in 143ms
npm info ok
$ node -p process.platform

darwin

Fixed by https://github.com/npm/cli/pull/173. Thanks for the report!

Is this issue every going to be released? The latest version of node 11.14.0 includes npm v6.9.0 with this bug…

1 Like

When will this #173 fix be released?
npm outdated is always broken in current version.

I’m still seeing this error with npm@6.9.0, node v11.14.0.

If you need this immediately, you need to update to npm@next (6.9.1-next.0) as per PR 173. :slight_smile:

2 Likes

Not trying to offend, but why has it been almost 2 months since the 6.9.1-next.0 pre-release with no further development activity? Given the pace of development for the last year it’s odd to see no commits at all since March 20 and no final release of 6.9.1. Is there something I’m missing that is hanging up the process?

2 Likes

Some day, javascript will be mature and enterprise-ready.

1 Like

And yet another node release (12.3) which includes the broken npm 6.9.0.

Please someone release 6.9.1 so I don’t have to keep reinstalling the next.0 version.

1 Like

Looking at the last discussion on the mentioned Pull Request

Looks like there is an internal issue at npm until 6.9.1 will be released

Why is @radum’s post flagged? It’s stating the truth.

The CLI Team Process wiki states as of the time of this posting:

The current release managers are the npm CLI team:


@audrey was fired March 22; and @fharper was fired as well; @iarna quit in response.

Time for entropic.dev?

2 Likes

Why is @radum’s post flagged?

I flagged it as not improving the discussion. (I sent the author a brief note too.)

See “Improve the Discussion” and "“If You See a Problem, Flag It”
https://npm.community/faq

So, without getting into the politics of whatever is going on, is there a plan at all right now for managing the npm-cli codebase? The lack of transparency right now is quite unsettling. It looks like for the moment at least we’re going to have to depend on yarn. It’s a shame, because after yarn came on the scene the NPM team was really working hard for quite some time and even caught up to/surpassed yarn in some ways.

3 Likes

Can yarn do what npm can? I just tried yarn global outdated and that doesn’t seem to work.

@retorquere There are a few quirks/differences with some specific commands (such as the one you mention), but overall both CLI tools are pretty comparable these days.

I’ve been using npm@6.9.1-next.0 with my various environments, but I just wanted to chime in with my frustrations at this not being released in a stable version of npm. It’s been more than a few months that this has been broken and running this command seems like a fairly common thing for people looking to keep their dependencies up to date. Sure there is a workaround using the next version, but it’s not a super obvious fix unless you stumble upon the right thread.

I just saw that 6.9.1 was released but is still on @next as supposed to @latest.
Has anyone tried that out?

I encountered issues after installing 6.9.1 when I tried installing a different version: Release: npm@6.9.1

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.