Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show all package dependency tree

Since 0.9.3 I'm having some problems with meteor package dependencies, for example some third party packages don't declare all of their dependencies (like underscore, which would normally be included but not when used by another package).

Is there a simple way to show the tree of dependencies, much like npm does?

meteor list will show what's in your project

.meteor/versions will show all packages but I'm trying to find out what is including (or not) other packages.

currently I'm getting errors like the following, but haven't included Minimongoid afaik and grepping finds no reference to it.

W20141001-19:19:46.137(-7)? (STDERR) /Users/dc/.meteor/packages/meteor-tool/.1.0.33.he3qxx++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173 W20141001-19:19:46.137(-7)? (STDERR)                        throw(ex); W20141001-19:19:46.138(-7)? (STDERR)                              ^ W20141001-19:19:46.141(-7)? (STDERR) ReferenceError: Minimongoid is not defined W20141001-19:19:46.141(-7)? (STDERR)     at collections/user.coffee:1:20 W20141001-19:19:46.141(-7)? (STDERR)     at /Users/dc/dev/shumi/package-dev/app/.meteor/local/build/programs/server/app/collections/user.coffee.js:24:3 W20141001-19:19:46.142(-7)? (STDERR)     at /Users/dc/dev/shumi/package-dev/app/.meteor/local/build/programs/server/boot.js:168:10 W20141001-19:19:46.142(-7)? (STDERR)     at Array.forEach (native) W20141001-19:19:46.142(-7)? (STDERR)     at Function._.each._.forEach (/Users/dc/.meteor/packages/meteor-tool/.1.0.33.he3qxx++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11) W20141001-19:19:46.142(-7)? (STDERR)     at /Users/dc/dev/shumi/package-dev/app/.meteor/local/build/programs/server/boot.js:82:5 
like image 601
dcsan Avatar asked Oct 02 '14 02:10

dcsan


People also ask

How do I see NPM package dependencies?

Use the npm list to show the installed packages in the current project as a dependency tree. Use npm list --depth=n to show the dependency tree with a specified depth. Use npm list --prod to show packages in the dependencies . Use npm list --dev to show packages in the devDependencies .

How do I see the dependency tree in PIP?

You can do it by installing pipdeptree package. Open command prompt in your project folder. If you are using any virtual environment, then switch to that virtual environment. This package will list all the dependencies of your project.

How do you print a dependency tree?

How to get the Maven Dependency Tree of a Project. We can run mvn dependency:tree command in the terminal to print the project dependency tree. For our example, I will be using the Mockito Tutorial project. You can download the project from the GitHub repository.


2 Answers

While we're waiting for the official tools to have this functionality, here's the uglyslow vershion:

for p in `meteor list | grep '^[a-z]' | awk '{ print $1"@"$2 }'`; do echo "$p"; meteor show "$p" | grep -E '^  [a-z]'; echo; done 

This will show the dependencies of all added packages. It parses the output of meteor list and meteor show package@version and will break when anything there changes.

like image 181
sba Avatar answered Oct 04 '22 17:10

sba


As of Meteor v1.5.2 (released 2017-09-05) you can now see the full dependency tree like this:

meteor list --tree

Here's what the output looks like:

$ meteor list --tree  [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] (top level) │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] (expanded above) │ │ │ ├── [email protected] (top level) │ │ │ ├─┬ [email protected] 

The pull request was contributed by sdarnel and can be found here for those interested: https://github.com/meteor/meteor/pull/8936

like image 37
alanning Avatar answered Oct 04 '22 17:10

alanning