Skip to content

Commit 609952c

Browse files
committed
Fix unmet peer dependency break adding of platform.
1 parent 19e6829 commit 609952c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/node-package-manager.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ export class NodePackageManager implements INodePackageManager {
147147
const originalOutput: INpmInstallCLIResult | INpm5InstallCliResult = JSON.parse(npmDryRunInstallOutput);
148148
const npm5Output = <INpm5InstallCliResult> originalOutput;
149149
const npmOutput = <INpmInstallCLIResult> originalOutput;
150-
const name = _.head(_.keys(npmOutput.dependencies));
150+
let name: string;
151+
_.forOwn(npmOutput.dependencies, (peerDependency: INpmPeerDependencyInfo, key: string) => {
152+
if (!peerDependency.required && !peerDependency.peerMissing) {
153+
name = key;
154+
}
155+
});
151156

152157
// Npm 5 return different object after performing `npm install --dry-run`.
153158
// Considering that the dependency is already installed we should

0 commit comments

Comments
 (0)