Cannot read property '0' of undefined
See original GitHub issuewhen i type madge in windows command line
madge app.js
i get
at commonJSLookup (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:208:14)
at jsLookup (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:154:14)
at cabinet (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:62:18)
at Function.module.exports._getDependencies (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:103:20)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:147:37)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: Cannot read Property '0' of Undefined in JS
The "Cannot read property '0' of undefined" error occurs when trying to access the 0th index in a variable that stores an undefined...
Read more >How To Fix Cannot read Property '0' of Undefined in JS
The Solution · Ensure you are using the correct variable · Perform a simple check on your variable before using it to make...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
If a property of an object is an array, it's possible to accidentally misspell the key or try to access the array through...
Read more >Javascript Uncaught TypeError: Cannot read property '0' of ...
You are passing the first item of words , instead of the array. Instead, pass the array to the function: hasLetter("a",words);.
Read more >npm error cannot read property 0 of undefined
npm error cannot read property 0 of undefined · delete node_modules folder · delete package-lock.json · do “npm install” to recreate your node_modules...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @techsin. Thanks for reporting the issue. Could you try a fresh install of madge and see if the problem persists? There was a bug fix to one of the dependencies pushed recently. I’m not sure that’ll fix the issue since versions have to match, but figured it would be worth trying in the meantime.
Woot. Glad to hear. https://github.com/dependents/node-detective-cjs/pull/9 was likely the fix. Enjoy!