File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/fosslight_dependency/package_manager Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,14 @@ def start_license_checker(self):
5353 self .flag_tmp_node_modules = True
5454 cmd_ret = subprocess .call (npm_install_cmd , shell = True )
5555 if cmd_ret != 0 :
56- logger .error (f"{ npm_install_cmd } returns an error" )
57- return False
56+ logger .warning (f"{ npm_install_cmd } returns an error. Trying yarn as fallback..." )
57+ yarn_install_cmd = 'yarn install --production --ignore-scripts'
58+ cmd_ret = subprocess .call (yarn_install_cmd , shell = True )
59+ if cmd_ret != 0 :
60+ logger .error (f"Both { npm_install_cmd } and { yarn_install_cmd } failed" )
61+ return False
62+ else :
63+ logger .info (f"Successfully executed { yarn_install_cmd } " )
5864
5965 # customized json file for obtaining specific items with license-checker
6066 self .make_custom_json (self .tmp_custom_json )
You can’t perform that action at this time.
0 commit comments