#1213: add "checkdeps" command #1279

wants to merge 3 commits into


None yet
5 participants

thejh commented Aug 17, 2011

See #1213.

isaacs commented on 3a1194f Aug 17, 2011

This is pretty good.

  1. I like to avoid stuff like "returns true if not ok". It'd be better if _checkdeps return value was reversed, or if the function was renamed to somethingMissing or hasProblem something, so that "true" means "yes".
  2. It'd be better if the data returned was somewhat useful. Maybe return which package is missing, and where. If you did that, you could even spit out the appropriate install commands for the user to copy and paste :)
  3. Note that something could be missing beyond the first level. If the item isn't a string, then you need to recursively check its deps as well.

thejh replied Aug 17, 2011

@isaacs, about number 3: Have a look at line 20, shouldn't that work?

Oh, right, I missed that.

Can't you end up with cycles? I think the readInstalled data structure may set a pointer to an object higher up the tree if that's the thing that satisfies the dependency.


thejh replied Aug 17, 2011

Could well be... :(


thejh commented Aug 17, 2011

Ok, fixed point 1, too.


thejh commented Aug 17, 2011

Alright, fancy output :)

[jann@Jann-PC express]$ node ../npm/bin/npm checkdeps
status:not ok
Please execute "npm install" to install connect, mime and qs and to fix connect-redis and stylus
[jann@Jann-PC express]$

isaacs commented Oct 1, 2011

Few issues:

  1. There are some style issues. if blocks should always have {} if they continue to the next line.
  2. The output should be a bit more helpful, maybe mention what's missing, and catch invalid options as well.
  3. If the parseable config flag is set, then the output should match npm ls --parseable --long

dshaw commented Oct 6, 2011

Perhaps npm uptodate is a better semantic. I'm not sure about the implementation, but I definitely want this feature.

Especially in development, I'm looking for a good, lightweight mechanism (preferably programmatic) to be able to notify team members that they need to update their dependencies.

temas commented Jan 26, 2012

Is this concept dead or orphaned?

@isaacs What's needed for this to land? I'd be happy to fix any remaining issues or clean up any coding style problems.


isaacs commented Oct 22, 2012

It's unclear that this is necessary.

There's already a npm outdated command that is essentially what @dshaw was asking for.

And npm ls will tell you (quite loudly) about missing dependencies.

I think it's better to just close this.

isaacs closed this Oct 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment