Have npm ls return non-zero error code for outdated deps #2798

polotek opened this Issue Sep 11, 2012 · 1 comment


None yet
2 participants

polotek commented Sep 11, 2012

npm ls have the same output but return a non-zero code for unmet our out of date deps.

In our local dev environments, we have an interface for managing updates. Previously with node services, we'd just run npm install all the time to make sure local packages were up to date. But our folks who maintain our dev setup want to improve the situation. We'd like to a) avoid network calls if everything is up to date, b) be able to query the status to update a UI.

They asked for a way to tell if there are any out of date or unmet deps for the project. My first thought was that npm ls could return a non-zero error code if things were out of date. But that doesn't work. Hence this issue. Right now I'm going to recommend something like npm ls | grep ... and switching off that. But I think it'd be nicer to depend on a nice error code. It could even be flag that activates the behavior, e.g. npm ls -E. If you like the idea, I can also take a stab at the patch.


isaacs commented Sep 12, 2012

That's a good idea.

@isaacs isaacs closed this in 0fc2c2d Sep 12, 2012

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