npm outdated error Cannot read property 'length' of undefined

Appears to be fixed in the next release, which isn't out yet.

https://github.com/npm/cli/pull/173

You can install the pre-release to fix it.

npm -g i npm@next

Update

NPM 6.9.2 is out

npm install -g npm


There is a bug in the npm, but you can easily fix it:

  1. Go to your npm folder (i.e. /usr/local/lib/node_modules) and find a outdated.js file (i.e. /usr/local/lib/node_modules/npm/lib/outdated.js for Mac or C:\Users\YOUR_USER_NAME\AppData\Roaming\npm\node_modules\npm\lib\outdated.js for Windows)
  2. Find a function makePretty and change

    deppath
    

    to

    deppath || 'global'
    

in my case it was line #152

I hope it helps! 🙂

Tags:

Node.Js

Npm