@@ -25,7 +25,6 @@ export class NodePackageManager implements INodePackageManager {
25
25
}
26
26
27
27
let jsonContentBefore = this . $fs . readJson ( path . join ( pathToSave , "package.json" ) ) . wait ( ) ;
28
- // let dependenciesBefore: Array<string> = [];
29
28
let dependenciesBefore = _ . keys ( jsonContentBefore . dependencies ) . concat ( _ . keys ( jsonContentBefore . devDependencies ) ) ;
30
29
31
30
let flags = this . getFlagsString ( config , true ) ;
@@ -36,6 +35,8 @@ export class NodePackageManager implements INodePackageManager {
36
35
params = params . concat ( flags ) ;
37
36
try {
38
37
this . $childProcess . spawnFromEvent ( this . getNpmExecutableName ( ) , params , "close" , { cwd : pathToSave } ) . wait ( ) ;
38
+ let spawnResult :ISpawnResult = this . $childProcess . spawnFromEvent ( this . getNpmExecutableName ( ) , params , "close" , { cwd : pathToSave } ) . wait ( ) ;
39
+ this . $logger . out ( spawnResult . stdout ) ;
39
40
} catch ( err ) {
40
41
if ( err . message && err . message . indexOf ( "EPEERINVALID" ) !== - 1 ) {
41
42
// Not installed peer dependencies are treated by npm 2 as errors, but npm 3 treats them as warnings.
@@ -92,7 +93,12 @@ export class NodePackageManager implements INodePackageManager {
92
93
public view ( packageName : string , config : any ) : IFuture < any > {
93
94
return ( ( ) => {
94
95
let flags = this . getFlagsString ( config , false ) ;
95
- let viewResult = this . $childProcess . exec ( `npm view ${ packageName } ${ flags } ` ) . wait ( ) ;
96
+ let viewResult : any ;
97
+ try {
98
+ viewResult = this . $childProcess . exec ( `npm view ${ packageName } ${ flags } ` ) . wait ( ) ;
99
+ } catch ( e ) {
100
+ this . $errors . failWithoutHelp ( e ) ;
101
+ }
96
102
return JSON . parse ( viewResult ) ;
97
103
} ) . future < any > ( ) ( ) ;
98
104
}
0 commit comments