Continue installing when one package fails #628
Comments
@hempels Thank you for reporting this. To provide some more context on why this would be useful: Node.js Tools for Visual Studio is currently using typings to improve our code completions/IntelliSense, and adding this option would be super helpful for our users (microsoft/nodejstools#1140). For installing multiple typings, we investigated running the typings command multiple times but there is too much overhead starting node each time. Providing an option to continue after errors would enable quick acquisition of all typings for a project. Otherwise, users end up with no IntelliSense if any typings file is missing, as they often are. We'd love to contribute this feature. Any chance someone could help us get started? |
You wouldn't need to run this from the CLI, you can use the core from https://github.com/typings/core directly. That said, there's two methods in here for singular or multiple installation: https://github.com/typings/core/blob/master/src/install.ts#L138-L154. I think it's actually a pretty simple fix, the offending line would be https://github.com/typings/core/blob/master/src/install.ts#L194. I'd merge writing with compiling, then make the result of |
What's the expected error handling for when something is not found but others are for general use-cases? NPM doesn't write anything when one package fails, for instance, which is consistent with Typings. |
@blakeembrey Thank you for the help. A small wrapper around typings-core may be the best solution for our needs. I just wanted to check before creating this to see if adding an option to typings itself would help other users. I also agree that the proposed option is different from how npm works, and could result in unexpected behavior (even if this option were behind a flag.) I'm going to investigate using Thanks. |
I do think users may want to see this also, just need to decide how it functions - mostly when it comes to errors and success since some values may succeed while others fail. It's possible the whole function could be changed to always succeed but emit events for errors instead. |
Description
When multiple packages are passed as arguments for install, typings stops whenever one of those fails (for instance, if a package is missing.) It would be helpful if it attempted each one independent of the result of the others.
Steps to Reproduce
Run typings using "install" with two packages listed, the first non-existent, the second valid.
Expected behavior:
Typings should report the error but continue attempting to install typings for remaining packages.
Actual behavior:
Typings stops with an ERR when the first package is tried and fails, and does not install the second.
Versions
1.0.5
The text was updated successfully, but these errors were encountered: