Uh oh!
There was an error while loading. Please reload this page.
outdated: fix rendering for global dependencies - #173
Conversation
ffxsam
commented
Apr 1, 2019
@zkat Error is back again. npm 6.9.0. Stack: |
Looks like the code is gone https://github.com/npm/cli/blob/latest/lib/outdated.js#L152 It looks it's gonna be fixed in 6.9.1 |
Looks like the code what fixed it is gone. So I reintroduce it. npm#173
jtsom
commented
Apr 13, 2019
Is this issue every going to be released? The latest version of node 11.14.0 includes npm v6.9.0 with this bug... |
Zearin
commented
Apr 19, 2019
I just found out I was getting the same error, from the same operation
functiondotindex(c){varm=/\.[^.]*$/.exec(c);if(m){returnm.index+1}elseif(c!==undefined){returnc.length}elsereturn0}NOTE: However, I don’t know enough about npm’s architecture to say whether this is actually the correct solution. It may be that the real issue is that npm is calling the I’ll let the experts take it from here. |
nikoladev
commented
Apr 20, 2019
@jtsom While we wait for npm i -g npm@6.9.1-next.0 |
Zearin
commented
Apr 25, 2019
@nikoladev Thanks! That is awesome :D |
Orel-A
commented
May 1, 2019
Why isn't it in @latest yet? |
jtsom
commented
May 22, 2019
Hello? Anyone home? Yet another node release (12.3) that includes the broken 6.9.0. What's the hold up?? Having to remember to reinstall a .next.0 version of NPM every time is not ideal. |
Zearin
commented
May 25, 2019
I’ve been wondering the same thing! So much work has gone into |
Zearin
commented
Jun 1, 2019
This fix was merged on 2019-03-20. Why hasn’t it been published as a |
volschin
commented
Jun 2, 2019
node 10.16 LTS is now also broken, beeing shipped with npm 6.9.0. Please take action. |
aeschright
commented
Jun 4, 2019
Hi everyone, here’s an update on what’s been happening with the open PRs https://gist.github.com/aeschright/8ed09cbc2a4aee00fcb4ad35086d76a6 |
Zearin
commented
Jun 27, 2019
@aeschright Thanks for writing that note. I am so sorry to hear the news. I really hope the company gets its head back on straight. |
brimarq
commented
Jun 27, 2019
@ZuBB I was having the same "Cannot read property 'length' of undefined" error when running |
@zkat I've just applied your change with the shipped npm v6.9.0 in nodejs v12.5.0. The error message is gone, but the column "Location" shows "global". I expected it to be I would suggest to improve your PR by changing to // outdated.js L148-153varcolumns=[depname,has||'MISSING',want,latest,deppath||npm.dir// or // deppath || `(global) ${npm.dir}`]Follow-up Question 1During the troubleshooting, I see one place potential to be the root cause. // outdated.js L216-222functionoutdated_(args,path,tree,parentHas,depth,opts,cb){if(!tree.package)tree.package={}if(path&&moduleName(tree))path+=' > '+tree.package.nameif(!path&&moduleName(tree))path=tree.package.name// <---- name set to be path??if(depth>opts.depth){returncb(null,[])}The function // utils/module-name.jsvarunknown=0functionmoduleName(tree){if(tree.name){returntree.name}varpkg=tree.package||treeif(isNotEmpty(pkg.name)&&typeofpkg.name==='string')returnpkg.name.trim()varpkgName=pathToPackageName(tree.path)if(pkgName!=='')returnpkgNameif(tree._invalidName!=null)returntree._invalidNametree._invalidName='!invalid#'+(++unknown)returntree._invalidName}If name is invalid, the function will return
Regarding this logic, the variable |

Fixes: https://npm.community/t/npm-outdated-throw-an-error-cannot-read-property-length-of-undefined/5929