We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 807542a commit 78b5635Copy full SHA for 78b5635
lib/commands/test-init.ts
@@ -45,9 +45,16 @@ class TestInitCommand implements ICommand {
45
46
for (let peerDependency in modulePeerDependencies) {
47
let dependencyVersion = modulePeerDependencies[peerDependency] || "*";
48
- await this.$npm.install(`${peerDependency}@${dependencyVersion}`, projectDir, {
49
- 'save-dev': true
50
- });
+
+ // catch errors when a peerDependency is already installed
+ // e.g karma is installed; karma-jasmine depends on karma and will try to install it again
51
+ try {
52
+ await this.$npm.install(`${peerDependency}@${dependencyVersion}`, projectDir, {
53
+ 'save-dev': true
54
+ });
55
+ } catch (e) {
56
+ this.$logger.info(e.message);
57
+ }
58
}
59
60
0 commit comments