#1213: add "checkdeps" command #1279

Closed
wants to merge 3 commits into
from

Projects

None yet

5 participants

@thejh

See #1213.

@isaacs
npm member

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.

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

npm member

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.

Could well be... :(

@thejh

Ok, fixed point 1, too.

@thejh

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
npm member

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

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

Is this concept dead or orphaned?

@scottgonzalez

@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
npm member

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 isaacs closed this Oct 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment