dependents / node-dependency-tree

Get the dependency tree of a module
MIT License
707 stars 84 forks source link

Doesn't run without eslint installed #101

Closed fcrick closed 5 years ago

fcrick commented 5 years ago

I get this after a fresh install:

$ dependency-tree
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module 'eslint/lib/util/traverser'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:657:17)

Would be nice if this was mentioned somewhere - just getting a call stack is not ideal.

pahen commented 5 years ago

I added a fix for that in Madge, but the fix should probably be in detective-typescript instead. Eslint must be installed as a peer dependency when typescript-eslint-parser is used. Agree @mrjoelkemp ?

pahen commented 5 years ago

See https://github.com/pahen/detective-typescript/pull/14

pahen commented 5 years ago

I found out that using typescript-estree instead of typescript-eslint-parser actually solves the problem since it's not dependending on eslint.

mrjoelkemp commented 5 years ago

Thanks for reporting @fcrick and thanks @pahen for pushing a fix. This landed in precinct, so a fresh install of dependency-tree should fix it. I'll bump the precinct version for dependency-tree and release a patch as well.

pahen commented 5 years ago

Sweeet! Works like a charm. Released Madge v3.4.3 with bumped dependency-tree now.