How to determine which package introduces an indirect dependency


#1

Before I was using aldeed:simple-schema package, then switched to the npm version and removed the package:
meteor remove aldeed:simple-schema
However when Meteor starts building, it reinstals the package, because of an indirect dependency on it from another package.
Is there a convenient way to identify the package introducing the indirect dependency?

Here is the content of the “packages” file:

meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.16 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.1.2 # Meteor’s client-side reactive programming library
standard-minifier-css@1.3.4 # CSS minifier run for production mode
standard-minifier-js@1.2.3 # JS minifier run for production mode
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.6.3 # Enable ECMAScript2015+ syntax in app code
twbs:bootstrap
fourseven:scss
logging@1.1.17
random@1.0.10
ejson@1.0.13
cfs:http-methods
tap:i18n
accounts-password@1.3.4
http@1.2.12
shell-server


#2

This depends on aldeed:simple-schema as you can see on the bottom right over at https://atmospherejs.com/tap/i18n

I think I vaguely remember a package or an online service (open source) with the ability to analyze your packages file to give you a visualization of your dependency tree, perhaps if you searched the forums you could find it.


#3

Thank you.

I actually did search before posting but I couldn’t find a convenient way of doing it. If you’re able to find it please share the link, I’m sure it’d help.


#4

Here it is (I think) https://gist.github.com/deanius/d3f18b07454cd8416417

props to @deanius

EDIT: and this https://github.com/meteor/meteor/issues/2853#issuecomment-283320603


#5

I can’t remember where I saw it on the forums, but someone had this posted:

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

It lists the direct dependencies for the top level packages. Takes a while to run, so issue the command in the meteor app’s root directory then go make a cup of coffee and come back to see something like:

...

accounts-password@1.3.4
  accounts-base@1.2.14
  check@1.2.4
  ddp@1.2.5
  ecmascript@0.6.2
  ejson@1.0.13
  email@1.1.18
  isobuild:isopack-2@1.0.0
  npm-bcrypt@0.9.2
  random@1.0.10
  sha@1.0.9
  srp@1.0.10
  underscore@1.0.10

accounts-ui@1.1.9
  accounts-base@1.2.7
  accounts-ui-unstyled@1.1.12
  isobuild:isopack-2@1.0.0
  less@2.6.0

babel-runtime@1.0.1
  es5-shim@4.6.15 (weak dependency)
  modules@0.7.7
  promise@0.8.8

...

Error on upgrading on Meteor 1.6
#6

Thanks! With the packages I have installed, it actually run in less than 1 minute!


#7

Hi everyone, this is an older topic but still shows in search so wanted to post an update.

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

accounts-password@1.4.0
├─┬ accounts-base@1.3.4
│ ├─┬ callback-hook@1.0.10
│ │ └── underscore@1.0.10
│ ├── check@1.2.5 (top level)
│ ├─┬ ddp@1.3.1
│ │ ├─┬ ddp-client@2.1.3
│ │ │ ├── callback-hook@1.0.10 (expanded above)
│ │ │ ├── check@1.2.5 (top level)
│ │ │ ├─┬ ddp-common@1.2.9

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