File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1803,10 +1803,18 @@ async function installLibraries() {
1803
1803
[ depName , version ] = depName . split ( '@' , 2 ) ;
1804
1804
}
1805
1805
1806
- adapter . log . debug ( `Found custom dependency in config: "${ libraries [ lib ] } " ( ${ depName } @${ version } ) ` ) ;
1806
+ adapter . log . debug ( `Found custom dependency in config: "${ depName } @${ version } " ` ) ;
1807
1807
1808
- if ( ! nodeFS . existsSync ( `${ __dirname } /node_modules/${ depName } /package.json` ) ) {
1809
- adapter . log . info ( `Installing custom dependency: "${ libraries [ lib ] } " (${ depName } @${ version } )` ) ;
1808
+ if ( typeof adapter . installNodeModule === 'function' ) {
1809
+ const result = await adapter . installNodeModule ( depName , { version } ) ;
1810
+ if ( result . success ) {
1811
+ adapter . log . debug ( `Installed custom dependency: "${ depName } @${ version } "` ) ;
1812
+
1813
+ context . mods [ depName ] = adapter . importNodeModule ( depName ) ;
1814
+ }
1815
+ } else if ( ! nodeFS . existsSync ( `${ __dirname } /node_modules/${ depName } /package.json` ) ) {
1816
+ // js-controller <= 6.x
1817
+ adapter . log . info ( `Installing custom dependency: "${ depName } @${ version } "` ) ;
1810
1818
1811
1819
try {
1812
1820
await installNpm ( libraries [ lib ] ) ;
You can’t perform that action at this time.
0 commit comments